1#![doc = "MAVLink paparazzi dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#![allow(clippy::match_single_binding)]
6#[cfg(feature = "arbitrary")]
7use arbitrary::Arbitrary;
8#[allow(unused_imports)]
9use bitflags::{bitflags, Flags};
10#[allow(unused_imports)]
11use mavlink_core::{
12 bytes::Bytes, bytes_mut::BytesMut, types::CharArray, MavlinkVersion, Message, MessageData,
13};
14#[allow(unused_imports)]
15use num_derive::{FromPrimitive, ToPrimitive};
16#[allow(unused_imports)]
17use num_traits::{FromPrimitive, ToPrimitive};
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20#[cfg(feature = "ts")]
21use ts_rs::TS;
22pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
23#[cfg_attr(feature = "ts", derive(TS))]
24#[cfg_attr(feature = "ts", ts(export))]
25#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
26#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27#[cfg_attr(feature = "serde", serde(tag = "type"))]
28#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29#[repr(u32)]
30#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
31pub enum ActuatorConfiguration {
32 #[doc = "Do nothing."]
33 ACTUATOR_CONFIGURATION_NONE = 0,
34 #[doc = "Command the actuator to beep now."]
35 ACTUATOR_CONFIGURATION_BEEP = 1,
36 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
37 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
38 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
39 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
40 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
41 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
42 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
43 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
44}
45impl ActuatorConfiguration {
46 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
47}
48impl Default for ActuatorConfiguration {
49 fn default() -> Self {
50 Self::DEFAULT
51 }
52}
53#[cfg_attr(feature = "ts", derive(TS))]
54#[cfg_attr(feature = "ts", ts(export))]
55#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
56#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
57#[cfg_attr(feature = "serde", serde(tag = "type"))]
58#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
59#[repr(u32)]
60#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
61pub enum ActuatorOutputFunction {
62 #[doc = "No function (disabled)."]
63 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
64 #[doc = "Motor 1"]
65 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
66 #[doc = "Motor 2"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
68 #[doc = "Motor 3"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
70 #[doc = "Motor 4"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
72 #[doc = "Motor 5"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
74 #[doc = "Motor 6"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
76 #[doc = "Motor 7"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
78 #[doc = "Motor 8"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
80 #[doc = "Motor 9"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
82 #[doc = "Motor 10"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
84 #[doc = "Motor 11"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
86 #[doc = "Motor 12"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
88 #[doc = "Motor 13"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
90 #[doc = "Motor 14"]
91 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
92 #[doc = "Motor 15"]
93 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
94 #[doc = "Motor 16"]
95 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
96 #[doc = "Servo 1"]
97 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
98 #[doc = "Servo 2"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
100 #[doc = "Servo 3"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
102 #[doc = "Servo 4"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
104 #[doc = "Servo 5"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
106 #[doc = "Servo 6"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
108 #[doc = "Servo 7"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
110 #[doc = "Servo 8"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
112 #[doc = "Servo 9"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
114 #[doc = "Servo 10"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
116 #[doc = "Servo 11"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
118 #[doc = "Servo 12"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
120 #[doc = "Servo 13"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
122 #[doc = "Servo 14"]
123 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
124 #[doc = "Servo 15"]
125 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
126 #[doc = "Servo 16"]
127 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
128}
129impl ActuatorOutputFunction {
130 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
131}
132impl Default for ActuatorOutputFunction {
133 fn default() -> Self {
134 Self::DEFAULT
135 }
136}
137#[cfg_attr(feature = "ts", derive(TS))]
138#[cfg_attr(feature = "ts", ts(export))]
139#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
140#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
141#[cfg_attr(feature = "serde", serde(tag = "type"))]
142#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
143#[repr(u32)]
144#[doc = "Enumeration of the ADSB altimeter types"]
145pub enum AdsbAltitudeType {
146 #[doc = "Altitude reported from a Baro source using QNH reference"]
147 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
148 #[doc = "Altitude reported from a GNSS source"]
149 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
150}
151impl AdsbAltitudeType {
152 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
153}
154impl Default for AdsbAltitudeType {
155 fn default() -> Self {
156 Self::DEFAULT
157 }
158}
159#[cfg_attr(feature = "ts", derive(TS))]
160#[cfg_attr(feature = "ts", ts(export))]
161#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
163#[cfg_attr(feature = "serde", serde(tag = "type"))]
164#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
165#[repr(u32)]
166#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
167pub enum AdsbEmitterType {
168 ADSB_EMITTER_TYPE_NO_INFO = 0,
169 ADSB_EMITTER_TYPE_LIGHT = 1,
170 ADSB_EMITTER_TYPE_SMALL = 2,
171 ADSB_EMITTER_TYPE_LARGE = 3,
172 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
173 ADSB_EMITTER_TYPE_HEAVY = 5,
174 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
175 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
176 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
177 ADSB_EMITTER_TYPE_GLIDER = 9,
178 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
179 ADSB_EMITTER_TYPE_PARACHUTE = 11,
180 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
181 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
182 ADSB_EMITTER_TYPE_UAV = 14,
183 ADSB_EMITTER_TYPE_SPACE = 15,
184 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
185 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
186 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
187 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
188}
189impl AdsbEmitterType {
190 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
191}
192impl Default for AdsbEmitterType {
193 fn default() -> Self {
194 Self::DEFAULT
195 }
196}
197bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
198impl AdsbFlags {
199 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
200}
201impl Default for AdsbFlags {
202 fn default() -> Self {
203 Self::DEFAULT
204 }
205}
206bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
207impl AisFlags {
208 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
209}
210impl Default for AisFlags {
211 fn default() -> Self {
212 Self::DEFAULT
213 }
214}
215#[cfg_attr(feature = "ts", derive(TS))]
216#[cfg_attr(feature = "ts", ts(export))]
217#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
218#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
219#[cfg_attr(feature = "serde", serde(tag = "type"))]
220#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
221#[repr(u32)]
222#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
223pub enum AisNavStatus {
224 #[doc = "Under way using engine."]
225 UNDER_WAY = 0,
226 AIS_NAV_ANCHORED = 1,
227 AIS_NAV_UN_COMMANDED = 2,
228 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
229 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
230 AIS_NAV_MOORED = 5,
231 AIS_NAV_AGROUND = 6,
232 AIS_NAV_FISHING = 7,
233 AIS_NAV_SAILING = 8,
234 AIS_NAV_RESERVED_HSC = 9,
235 AIS_NAV_RESERVED_WIG = 10,
236 AIS_NAV_RESERVED_1 = 11,
237 AIS_NAV_RESERVED_2 = 12,
238 AIS_NAV_RESERVED_3 = 13,
239 #[doc = "Search And Rescue Transponder."]
240 AIS_NAV_AIS_SART = 14,
241 #[doc = "Not available (default)."]
242 AIS_NAV_UNKNOWN = 15,
243}
244impl AisNavStatus {
245 pub const DEFAULT: Self = Self::UNDER_WAY;
246}
247impl Default for AisNavStatus {
248 fn default() -> Self {
249 Self::DEFAULT
250 }
251}
252#[cfg_attr(feature = "ts", derive(TS))]
253#[cfg_attr(feature = "ts", ts(export))]
254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
256#[cfg_attr(feature = "serde", serde(tag = "type"))]
257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
258#[repr(u32)]
259#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
260pub enum AisType {
261 #[doc = "Not available (default)."]
262 AIS_TYPE_UNKNOWN = 0,
263 AIS_TYPE_RESERVED_1 = 1,
264 AIS_TYPE_RESERVED_2 = 2,
265 AIS_TYPE_RESERVED_3 = 3,
266 AIS_TYPE_RESERVED_4 = 4,
267 AIS_TYPE_RESERVED_5 = 5,
268 AIS_TYPE_RESERVED_6 = 6,
269 AIS_TYPE_RESERVED_7 = 7,
270 AIS_TYPE_RESERVED_8 = 8,
271 AIS_TYPE_RESERVED_9 = 9,
272 AIS_TYPE_RESERVED_10 = 10,
273 AIS_TYPE_RESERVED_11 = 11,
274 AIS_TYPE_RESERVED_12 = 12,
275 AIS_TYPE_RESERVED_13 = 13,
276 AIS_TYPE_RESERVED_14 = 14,
277 AIS_TYPE_RESERVED_15 = 15,
278 AIS_TYPE_RESERVED_16 = 16,
279 AIS_TYPE_RESERVED_17 = 17,
280 AIS_TYPE_RESERVED_18 = 18,
281 AIS_TYPE_RESERVED_19 = 19,
282 #[doc = "Wing In Ground effect."]
283 AIS_TYPE_WIG = 20,
284 AIS_TYPE_WIG_HAZARDOUS_A = 21,
285 AIS_TYPE_WIG_HAZARDOUS_B = 22,
286 AIS_TYPE_WIG_HAZARDOUS_C = 23,
287 AIS_TYPE_WIG_HAZARDOUS_D = 24,
288 AIS_TYPE_WIG_RESERVED_1 = 25,
289 AIS_TYPE_WIG_RESERVED_2 = 26,
290 AIS_TYPE_WIG_RESERVED_3 = 27,
291 AIS_TYPE_WIG_RESERVED_4 = 28,
292 AIS_TYPE_WIG_RESERVED_5 = 29,
293 AIS_TYPE_FISHING = 30,
294 AIS_TYPE_TOWING = 31,
295 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
296 AIS_TYPE_TOWING_LARGE = 32,
297 #[doc = "Dredging or other underwater ops."]
298 AIS_TYPE_DREDGING = 33,
299 AIS_TYPE_DIVING = 34,
300 AIS_TYPE_MILITARY = 35,
301 AIS_TYPE_SAILING = 36,
302 AIS_TYPE_PLEASURE = 37,
303 AIS_TYPE_RESERVED_20 = 38,
304 AIS_TYPE_RESERVED_21 = 39,
305 #[doc = "High Speed Craft."]
306 AIS_TYPE_HSC = 40,
307 AIS_TYPE_HSC_HAZARDOUS_A = 41,
308 AIS_TYPE_HSC_HAZARDOUS_B = 42,
309 AIS_TYPE_HSC_HAZARDOUS_C = 43,
310 AIS_TYPE_HSC_HAZARDOUS_D = 44,
311 AIS_TYPE_HSC_RESERVED_1 = 45,
312 AIS_TYPE_HSC_RESERVED_2 = 46,
313 AIS_TYPE_HSC_RESERVED_3 = 47,
314 AIS_TYPE_HSC_RESERVED_4 = 48,
315 AIS_TYPE_HSC_UNKNOWN = 49,
316 AIS_TYPE_PILOT = 50,
317 #[doc = "Search And Rescue vessel."]
318 AIS_TYPE_SAR = 51,
319 AIS_TYPE_TUG = 52,
320 AIS_TYPE_PORT_TENDER = 53,
321 #[doc = "Anti-pollution equipment."]
322 AIS_TYPE_ANTI_POLLUTION = 54,
323 AIS_TYPE_LAW_ENFORCEMENT = 55,
324 AIS_TYPE_SPARE_LOCAL_1 = 56,
325 AIS_TYPE_SPARE_LOCAL_2 = 57,
326 AIS_TYPE_MEDICAL_TRANSPORT = 58,
327 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
328 AIS_TYPE_NONECOMBATANT = 59,
329 AIS_TYPE_PASSENGER = 60,
330 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
331 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
332 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
333 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
334 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
335 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
336 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
337 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
338 AIS_TYPE_PASSENGER_UNKNOWN = 69,
339 AIS_TYPE_CARGO = 70,
340 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
341 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
342 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
343 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
344 AIS_TYPE_CARGO_RESERVED_1 = 75,
345 AIS_TYPE_CARGO_RESERVED_2 = 76,
346 AIS_TYPE_CARGO_RESERVED_3 = 77,
347 AIS_TYPE_CARGO_RESERVED_4 = 78,
348 AIS_TYPE_CARGO_UNKNOWN = 79,
349 AIS_TYPE_TANKER = 80,
350 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
351 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
352 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
353 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
354 AIS_TYPE_TANKER_RESERVED_1 = 85,
355 AIS_TYPE_TANKER_RESERVED_2 = 86,
356 AIS_TYPE_TANKER_RESERVED_3 = 87,
357 AIS_TYPE_TANKER_RESERVED_4 = 88,
358 AIS_TYPE_TANKER_UNKNOWN = 89,
359 AIS_TYPE_OTHER = 90,
360 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
361 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
362 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
363 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
364 AIS_TYPE_OTHER_RESERVED_1 = 95,
365 AIS_TYPE_OTHER_RESERVED_2 = 96,
366 AIS_TYPE_OTHER_RESERVED_3 = 97,
367 AIS_TYPE_OTHER_RESERVED_4 = 98,
368 AIS_TYPE_OTHER_UNKNOWN = 99,
369}
370impl AisType {
371 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
372}
373impl Default for AisType {
374 fn default() -> Self {
375 Self::DEFAULT
376 }
377}
378bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
379impl AttitudeTargetTypemask {
380 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
381}
382impl Default for AttitudeTargetTypemask {
383 fn default() -> Self {
384 Self::DEFAULT
385 }
386}
387#[cfg_attr(feature = "ts", derive(TS))]
388#[cfg_attr(feature = "ts", ts(export))]
389#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
390#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
391#[cfg_attr(feature = "serde", serde(tag = "type"))]
392#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
393#[repr(u32)]
394#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
395pub enum AutotuneAxis {
396 #[doc = "Autotune roll axis."]
397 AUTOTUNE_AXIS_ROLL = 1,
398 #[doc = "Autotune pitch axis."]
399 AUTOTUNE_AXIS_PITCH = 2,
400 #[doc = "Autotune yaw axis."]
401 AUTOTUNE_AXIS_YAW = 4,
402}
403impl AutotuneAxis {
404 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
405}
406impl Default for AutotuneAxis {
407 fn default() -> Self {
408 Self::DEFAULT
409 }
410}
411bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
412impl CameraCapFlags {
413 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
414}
415impl Default for CameraCapFlags {
416 fn default() -> Self {
417 Self::DEFAULT
418 }
419}
420#[cfg_attr(feature = "ts", derive(TS))]
421#[cfg_attr(feature = "ts", ts(export))]
422#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
423#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
424#[cfg_attr(feature = "serde", serde(tag = "type"))]
425#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
426#[repr(u32)]
427#[doc = "Camera Modes."]
428pub enum CameraMode {
429 #[doc = "Camera is in image/photo capture mode."]
430 CAMERA_MODE_IMAGE = 0,
431 #[doc = "Camera is in video capture mode."]
432 CAMERA_MODE_VIDEO = 1,
433 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
434 CAMERA_MODE_IMAGE_SURVEY = 2,
435}
436impl CameraMode {
437 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
438}
439impl Default for CameraMode {
440 fn default() -> Self {
441 Self::DEFAULT
442 }
443}
444#[cfg_attr(feature = "ts", derive(TS))]
445#[cfg_attr(feature = "ts", ts(export))]
446#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
448#[cfg_attr(feature = "serde", serde(tag = "type"))]
449#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
450#[repr(u32)]
451#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
452pub enum CameraSource {
453 #[doc = "Default camera source."]
454 CAMERA_SOURCE_DEFAULT = 0,
455 #[doc = "RGB camera source."]
456 CAMERA_SOURCE_RGB = 1,
457 #[doc = "IR camera source."]
458 CAMERA_SOURCE_IR = 2,
459 #[doc = "NDVI camera source."]
460 CAMERA_SOURCE_NDVI = 3,
461}
462impl CameraSource {
463 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
464}
465impl Default for CameraSource {
466 fn default() -> Self {
467 Self::DEFAULT
468 }
469}
470#[cfg_attr(feature = "ts", derive(TS))]
471#[cfg_attr(feature = "ts", ts(export))]
472#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
474#[cfg_attr(feature = "serde", serde(tag = "type"))]
475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
476#[repr(u32)]
477#[doc = "Camera tracking modes"]
478pub enum CameraTrackingMode {
479 #[doc = "Not tracking"]
480 CAMERA_TRACKING_MODE_NONE = 0,
481 #[doc = "Target is a point"]
482 CAMERA_TRACKING_MODE_POINT = 1,
483 #[doc = "Target is a rectangle"]
484 CAMERA_TRACKING_MODE_RECTANGLE = 2,
485}
486impl CameraTrackingMode {
487 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
488}
489impl Default for CameraTrackingMode {
490 fn default() -> Self {
491 Self::DEFAULT
492 }
493}
494#[cfg_attr(feature = "ts", derive(TS))]
495#[cfg_attr(feature = "ts", ts(export))]
496#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
498#[cfg_attr(feature = "serde", serde(tag = "type"))]
499#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
500#[repr(u32)]
501#[doc = "Camera tracking status flags"]
502pub enum CameraTrackingStatusFlags {
503 #[doc = "Camera is not tracking"]
504 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
505 #[doc = "Camera is tracking"]
506 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
507 #[doc = "Camera tracking in error state"]
508 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
509}
510impl CameraTrackingStatusFlags {
511 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
512}
513impl Default for CameraTrackingStatusFlags {
514 fn default() -> Self {
515 Self::DEFAULT
516 }
517}
518bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
519impl CameraTrackingTargetData {
520 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
521}
522impl Default for CameraTrackingTargetData {
523 fn default() -> Self {
524 Self::DEFAULT
525 }
526}
527#[cfg_attr(feature = "ts", derive(TS))]
528#[cfg_attr(feature = "ts", ts(export))]
529#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
531#[cfg_attr(feature = "serde", serde(tag = "type"))]
532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
533#[repr(u32)]
534#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
535pub enum CameraZoomType {
536 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
537 ZOOM_TYPE_STEP = 0,
538 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
539 ZOOM_TYPE_CONTINUOUS = 1,
540 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
541 ZOOM_TYPE_RANGE = 2,
542 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
543 ZOOM_TYPE_FOCAL_LENGTH = 3,
544 #[doc = "Zoom value as horizontal field of view in degrees."]
545 ZOOM_TYPE_HORIZONTAL_FOV = 4,
546}
547impl CameraZoomType {
548 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
549}
550impl Default for CameraZoomType {
551 fn default() -> Self {
552 Self::DEFAULT
553 }
554}
555#[cfg_attr(feature = "ts", derive(TS))]
556#[cfg_attr(feature = "ts", ts(export))]
557#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
558#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
559#[cfg_attr(feature = "serde", serde(tag = "type"))]
560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
561#[repr(u32)]
562pub enum CanFilterOp {
563 CAN_FILTER_REPLACE = 0,
564 CAN_FILTER_ADD = 1,
565 CAN_FILTER_REMOVE = 2,
566}
567impl CanFilterOp {
568 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
569}
570impl Default for CanFilterOp {
571 fn default() -> Self {
572 Self::DEFAULT
573 }
574}
575#[cfg_attr(feature = "ts", derive(TS))]
576#[cfg_attr(feature = "ts", ts(export))]
577#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
579#[cfg_attr(feature = "serde", serde(tag = "type"))]
580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
581#[repr(u32)]
582#[doc = "Possible responses from a CELLULAR_CONFIG message."]
583pub enum CellularConfigResponse {
584 #[doc = "Changes accepted."]
585 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
586 #[doc = "Invalid APN."]
587 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
588 #[doc = "Invalid PIN."]
589 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
590 #[doc = "Changes rejected."]
591 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
592 #[doc = "PUK is required to unblock SIM card."]
593 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
594}
595impl CellularConfigResponse {
596 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
597}
598impl Default for CellularConfigResponse {
599 fn default() -> Self {
600 Self::DEFAULT
601 }
602}
603#[cfg_attr(feature = "ts", derive(TS))]
604#[cfg_attr(feature = "ts", ts(export))]
605#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
607#[cfg_attr(feature = "serde", serde(tag = "type"))]
608#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
609#[repr(u32)]
610#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
611pub enum CellularNetworkFailedReason {
612 #[doc = "No error"]
613 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
614 #[doc = "Error state is unknown"]
615 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
616 #[doc = "SIM is required for the modem but missing"]
617 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
618 #[doc = "SIM is available, but not usable for connection"]
619 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
620}
621impl CellularNetworkFailedReason {
622 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
623}
624impl Default for CellularNetworkFailedReason {
625 fn default() -> Self {
626 Self::DEFAULT
627 }
628}
629#[cfg_attr(feature = "ts", derive(TS))]
630#[cfg_attr(feature = "ts", ts(export))]
631#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
632#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
633#[cfg_attr(feature = "serde", serde(tag = "type"))]
634#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
635#[repr(u32)]
636#[doc = "Cellular network radio type"]
637pub enum CellularNetworkRadioType {
638 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
639 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
640 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
641 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
642 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
643}
644impl CellularNetworkRadioType {
645 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
646}
647impl Default for CellularNetworkRadioType {
648 fn default() -> Self {
649 Self::DEFAULT
650 }
651}
652#[cfg_attr(feature = "ts", derive(TS))]
653#[cfg_attr(feature = "ts", ts(export))]
654#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
655#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
656#[cfg_attr(feature = "serde", serde(tag = "type"))]
657#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
658#[repr(u32)]
659#[doc = "These flags encode the cellular network status"]
660pub enum CellularStatusFlag {
661 #[doc = "State unknown or not reportable."]
662 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
663 #[doc = "Modem is unusable"]
664 CELLULAR_STATUS_FLAG_FAILED = 1,
665 #[doc = "Modem is being initialized"]
666 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
667 #[doc = "Modem is locked"]
668 CELLULAR_STATUS_FLAG_LOCKED = 3,
669 #[doc = "Modem is not enabled and is powered down"]
670 CELLULAR_STATUS_FLAG_DISABLED = 4,
671 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
672 CELLULAR_STATUS_FLAG_DISABLING = 5,
673 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
674 CELLULAR_STATUS_FLAG_ENABLING = 6,
675 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
676 CELLULAR_STATUS_FLAG_ENABLED = 7,
677 #[doc = "Modem is searching for a network provider to register"]
678 CELLULAR_STATUS_FLAG_SEARCHING = 8,
679 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
680 CELLULAR_STATUS_FLAG_REGISTERED = 9,
681 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
682 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
683 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
684 CELLULAR_STATUS_FLAG_CONNECTING = 11,
685 #[doc = "One or more packet data bearers is active and connected"]
686 CELLULAR_STATUS_FLAG_CONNECTED = 12,
687}
688impl CellularStatusFlag {
689 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
690}
691impl Default for CellularStatusFlag {
692 fn default() -> Self {
693 Self::DEFAULT
694 }
695}
696#[cfg_attr(feature = "ts", derive(TS))]
697#[cfg_attr(feature = "ts", ts(export))]
698#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
699#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
700#[cfg_attr(feature = "serde", serde(tag = "type"))]
701#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
702#[repr(u32)]
703#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
704pub enum CompMetadataType {
705 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
706 COMP_METADATA_TYPE_GENERAL = 0,
707 #[doc = "Parameter meta data."]
708 COMP_METADATA_TYPE_PARAMETER = 1,
709 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
710 COMP_METADATA_TYPE_COMMANDS = 2,
711 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
712 COMP_METADATA_TYPE_PERIPHERALS = 3,
713 #[doc = "Meta data for the events interface."]
714 COMP_METADATA_TYPE_EVENTS = 4,
715 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
716 COMP_METADATA_TYPE_ACTUATORS = 5,
717}
718impl CompMetadataType {
719 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
720}
721impl Default for CompMetadataType {
722 fn default() -> Self {
723 Self::DEFAULT
724 }
725}
726#[cfg_attr(feature = "ts", derive(TS))]
727#[cfg_attr(feature = "ts", ts(export))]
728#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
730#[cfg_attr(feature = "serde", serde(tag = "type"))]
731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
732#[repr(u32)]
733#[doc = "Indicates the ESC connection type."]
734pub enum EscConnectionType {
735 #[doc = "Traditional PPM ESC."]
736 ESC_CONNECTION_TYPE_PPM = 0,
737 #[doc = "Serial Bus connected ESC."]
738 ESC_CONNECTION_TYPE_SERIAL = 1,
739 #[doc = "One Shot PPM ESC."]
740 ESC_CONNECTION_TYPE_ONESHOT = 2,
741 #[doc = "I2C ESC."]
742 ESC_CONNECTION_TYPE_I2C = 3,
743 #[doc = "CAN-Bus ESC."]
744 ESC_CONNECTION_TYPE_CAN = 4,
745 #[doc = "DShot ESC."]
746 ESC_CONNECTION_TYPE_DSHOT = 5,
747}
748impl EscConnectionType {
749 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
750}
751impl Default for EscConnectionType {
752 fn default() -> Self {
753 Self::DEFAULT
754 }
755}
756bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
757impl EscFailureFlags {
758 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
759}
760impl Default for EscFailureFlags {
761 fn default() -> Self {
762 Self::DEFAULT
763 }
764}
765bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
766impl EstimatorStatusFlags {
767 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
768}
769impl Default for EstimatorStatusFlags {
770 fn default() -> Self {
771 Self::DEFAULT
772 }
773}
774#[cfg_attr(feature = "ts", derive(TS))]
775#[cfg_attr(feature = "ts", ts(export))]
776#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
777#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
778#[cfg_attr(feature = "serde", serde(tag = "type"))]
779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
780#[repr(u32)]
781#[doc = "List of possible failure type to inject."]
782pub enum FailureType {
783 #[doc = "No failure injected, used to reset a previous failure."]
784 FAILURE_TYPE_OK = 0,
785 #[doc = "Sets unit off, so completely non-responsive."]
786 FAILURE_TYPE_OFF = 1,
787 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
788 FAILURE_TYPE_STUCK = 2,
789 #[doc = "Unit is reporting complete garbage."]
790 FAILURE_TYPE_GARBAGE = 3,
791 #[doc = "Unit is consistently wrong."]
792 FAILURE_TYPE_WRONG = 4,
793 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
794 FAILURE_TYPE_SLOW = 5,
795 #[doc = "Data of unit is delayed in time."]
796 FAILURE_TYPE_DELAYED = 6,
797 #[doc = "Unit is sometimes working, sometimes not."]
798 FAILURE_TYPE_INTERMITTENT = 7,
799}
800impl FailureType {
801 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
802}
803impl Default for FailureType {
804 fn default() -> Self {
805 Self::DEFAULT
806 }
807}
808#[cfg_attr(feature = "ts", derive(TS))]
809#[cfg_attr(feature = "ts", ts(export))]
810#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
812#[cfg_attr(feature = "serde", serde(tag = "type"))]
813#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
814#[repr(u32)]
815#[doc = "List of possible units where failures can be injected."]
816pub enum FailureUnit {
817 FAILURE_UNIT_SENSOR_GYRO = 0,
818 FAILURE_UNIT_SENSOR_ACCEL = 1,
819 FAILURE_UNIT_SENSOR_MAG = 2,
820 FAILURE_UNIT_SENSOR_BARO = 3,
821 FAILURE_UNIT_SENSOR_GPS = 4,
822 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
823 FAILURE_UNIT_SENSOR_VIO = 6,
824 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
825 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
826 FAILURE_UNIT_SYSTEM_BATTERY = 100,
827 FAILURE_UNIT_SYSTEM_MOTOR = 101,
828 FAILURE_UNIT_SYSTEM_SERVO = 102,
829 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
830 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
831 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
832}
833impl FailureUnit {
834 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
835}
836impl Default for FailureUnit {
837 fn default() -> Self {
838 Self::DEFAULT
839 }
840}
841#[cfg_attr(feature = "ts", derive(TS))]
842#[cfg_attr(feature = "ts", ts(export))]
843#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
844#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
845#[cfg_attr(feature = "serde", serde(tag = "type"))]
846#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
847#[repr(u32)]
848pub enum FenceBreach {
849 #[doc = "No last fence breach"]
850 FENCE_BREACH_NONE = 0,
851 #[doc = "Breached minimum altitude"]
852 FENCE_BREACH_MINALT = 1,
853 #[doc = "Breached maximum altitude"]
854 FENCE_BREACH_MAXALT = 2,
855 #[doc = "Breached fence boundary"]
856 FENCE_BREACH_BOUNDARY = 3,
857}
858impl FenceBreach {
859 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
860}
861impl Default for FenceBreach {
862 fn default() -> Self {
863 Self::DEFAULT
864 }
865}
866#[cfg_attr(feature = "ts", derive(TS))]
867#[cfg_attr(feature = "ts", ts(export))]
868#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
870#[cfg_attr(feature = "serde", serde(tag = "type"))]
871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
872#[repr(u32)]
873#[doc = "Actions being taken to mitigate/prevent fence breach"]
874pub enum FenceMitigate {
875 #[doc = "Unknown"]
876 FENCE_MITIGATE_UNKNOWN = 0,
877 #[doc = "No actions being taken"]
878 FENCE_MITIGATE_NONE = 1,
879 #[doc = "Velocity limiting active to prevent breach"]
880 FENCE_MITIGATE_VEL_LIMIT = 2,
881}
882impl FenceMitigate {
883 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
884}
885impl Default for FenceMitigate {
886 fn default() -> Self {
887 Self::DEFAULT
888 }
889}
890#[cfg_attr(feature = "ts", derive(TS))]
891#[cfg_attr(feature = "ts", ts(export))]
892#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
894#[cfg_attr(feature = "serde", serde(tag = "type"))]
895#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
896#[repr(u32)]
897#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
898pub enum FenceType {
899 #[doc = "Maximum altitude fence"]
900 FENCE_TYPE_ALT_MAX = 1,
901 #[doc = "Circle fence"]
902 FENCE_TYPE_CIRCLE = 2,
903 #[doc = "Polygon fence"]
904 FENCE_TYPE_POLYGON = 4,
905 #[doc = "Minimum altitude fence"]
906 FENCE_TYPE_ALT_MIN = 8,
907}
908impl FenceType {
909 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
910}
911impl Default for FenceType {
912 fn default() -> Self {
913 Self::DEFAULT
914 }
915}
916#[cfg_attr(feature = "ts", derive(TS))]
917#[cfg_attr(feature = "ts", ts(export))]
918#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
920#[cfg_attr(feature = "serde", serde(tag = "type"))]
921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
922#[repr(u32)]
923#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
924pub enum FirmwareVersionType {
925 #[doc = "development release"]
926 FIRMWARE_VERSION_TYPE_DEV = 0,
927 #[doc = "alpha release"]
928 FIRMWARE_VERSION_TYPE_ALPHA = 64,
929 #[doc = "beta release"]
930 FIRMWARE_VERSION_TYPE_BETA = 128,
931 #[doc = "release candidate"]
932 FIRMWARE_VERSION_TYPE_RC = 192,
933 #[doc = "official stable release"]
934 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
935}
936impl FirmwareVersionType {
937 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
938}
939impl Default for FirmwareVersionType {
940 fn default() -> Self {
941 Self::DEFAULT
942 }
943}
944bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
945impl GimbalDeviceCapFlags {
946 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
947}
948impl Default for GimbalDeviceCapFlags {
949 fn default() -> Self {
950 Self::DEFAULT
951 }
952}
953bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
954impl GimbalDeviceErrorFlags {
955 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
956}
957impl Default for GimbalDeviceErrorFlags {
958 fn default() -> Self {
959 Self::DEFAULT
960 }
961}
962bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
963impl GimbalDeviceFlags {
964 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
965}
966impl Default for GimbalDeviceFlags {
967 fn default() -> Self {
968 Self::DEFAULT
969 }
970}
971bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
972impl GimbalManagerCapFlags {
973 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
974}
975impl Default for GimbalManagerCapFlags {
976 fn default() -> Self {
977 Self::DEFAULT
978 }
979}
980bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
981impl GimbalManagerFlags {
982 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
983}
984impl Default for GimbalManagerFlags {
985 fn default() -> Self {
986 Self::DEFAULT
987 }
988}
989#[cfg_attr(feature = "ts", derive(TS))]
990#[cfg_attr(feature = "ts", ts(export))]
991#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
993#[cfg_attr(feature = "serde", serde(tag = "type"))]
994#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
995#[repr(u32)]
996#[doc = "Type of GPS fix"]
997pub enum GpsFixType {
998 #[doc = "No GPS connected"]
999 GPS_FIX_TYPE_NO_GPS = 0,
1000 #[doc = "No position information, GPS is connected"]
1001 GPS_FIX_TYPE_NO_FIX = 1,
1002 #[doc = "2D position"]
1003 GPS_FIX_TYPE_2D_FIX = 2,
1004 #[doc = "3D position"]
1005 GPS_FIX_TYPE_3D_FIX = 3,
1006 #[doc = "DGPS/SBAS aided 3D position"]
1007 GPS_FIX_TYPE_DGPS = 4,
1008 #[doc = "RTK float, 3D position"]
1009 GPS_FIX_TYPE_RTK_FLOAT = 5,
1010 #[doc = "RTK Fixed, 3D position"]
1011 GPS_FIX_TYPE_RTK_FIXED = 6,
1012 #[doc = "Static fixed, typically used for base stations"]
1013 GPS_FIX_TYPE_STATIC = 7,
1014 #[doc = "PPP, 3D position."]
1015 GPS_FIX_TYPE_PPP = 8,
1016}
1017impl GpsFixType {
1018 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1019}
1020impl Default for GpsFixType {
1021 fn default() -> Self {
1022 Self::DEFAULT
1023 }
1024}
1025bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1026impl GpsInputIgnoreFlags {
1027 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1028}
1029impl Default for GpsInputIgnoreFlags {
1030 fn default() -> Self {
1031 Self::DEFAULT
1032 }
1033}
1034#[cfg_attr(feature = "ts", derive(TS))]
1035#[cfg_attr(feature = "ts", ts(export))]
1036#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1037#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1038#[cfg_attr(feature = "serde", serde(tag = "type"))]
1039#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1040#[repr(u32)]
1041#[doc = "Gripper actions."]
1042pub enum GripperActions {
1043 #[doc = "Gripper release cargo."]
1044 GRIPPER_ACTION_RELEASE = 0,
1045 #[doc = "Gripper grab onto cargo."]
1046 GRIPPER_ACTION_GRAB = 1,
1047}
1048impl GripperActions {
1049 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1050}
1051impl Default for GripperActions {
1052 fn default() -> Self {
1053 Self::DEFAULT
1054 }
1055}
1056bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1057impl HighresImuUpdatedFlags {
1058 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1059}
1060impl Default for HighresImuUpdatedFlags {
1061 fn default() -> Self {
1062 Self::DEFAULT
1063 }
1064}
1065bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1066impl HilActuatorControlsFlags {
1067 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1068}
1069impl Default for HilActuatorControlsFlags {
1070 fn default() -> Self {
1071 Self::DEFAULT
1072 }
1073}
1074bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1075impl HilSensorUpdatedFlags {
1076 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1077}
1078impl Default for HilSensorUpdatedFlags {
1079 fn default() -> Self {
1080 Self::DEFAULT
1081 }
1082}
1083bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1084impl HlFailureFlag {
1085 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1086}
1087impl Default for HlFailureFlag {
1088 fn default() -> Self {
1089 Self::DEFAULT
1090 }
1091}
1092bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1093impl IlluminatorErrorFlags {
1094 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1095}
1096impl Default for IlluminatorErrorFlags {
1097 fn default() -> Self {
1098 Self::DEFAULT
1099 }
1100}
1101#[cfg_attr(feature = "ts", derive(TS))]
1102#[cfg_attr(feature = "ts", ts(export))]
1103#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1105#[cfg_attr(feature = "serde", serde(tag = "type"))]
1106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1107#[repr(u32)]
1108#[doc = "Modes of illuminator"]
1109pub enum IlluminatorMode {
1110 #[doc = "Illuminator mode is not specified/unknown"]
1111 ILLUMINATOR_MODE_UNKNOWN = 0,
1112 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1113 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1114 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1115 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1116}
1117impl IlluminatorMode {
1118 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1119}
1120impl Default for IlluminatorMode {
1121 fn default() -> Self {
1122 Self::DEFAULT
1123 }
1124}
1125#[cfg_attr(feature = "ts", derive(TS))]
1126#[cfg_attr(feature = "ts", ts(export))]
1127#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1129#[cfg_attr(feature = "serde", serde(tag = "type"))]
1130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1131#[repr(u32)]
1132#[doc = "Type of landing target"]
1133pub enum LandingTargetType {
1134 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1135 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1136 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1137 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1138 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1139 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1140 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1141 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1142}
1143impl LandingTargetType {
1144 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1145}
1146impl Default for LandingTargetType {
1147 fn default() -> Self {
1148 Self::DEFAULT
1149 }
1150}
1151#[cfg_attr(feature = "ts", derive(TS))]
1152#[cfg_attr(feature = "ts", ts(export))]
1153#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1155#[cfg_attr(feature = "serde", serde(tag = "type"))]
1156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1157#[repr(u32)]
1158pub enum MagCalStatus {
1159 MAG_CAL_NOT_STARTED = 0,
1160 MAG_CAL_WAITING_TO_START = 1,
1161 MAG_CAL_RUNNING_STEP_ONE = 2,
1162 MAG_CAL_RUNNING_STEP_TWO = 3,
1163 MAG_CAL_SUCCESS = 4,
1164 MAG_CAL_FAILED = 5,
1165 MAG_CAL_BAD_ORIENTATION = 6,
1166 MAG_CAL_BAD_RADIUS = 7,
1167}
1168impl MagCalStatus {
1169 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1170}
1171impl Default for MagCalStatus {
1172 fn default() -> Self {
1173 Self::DEFAULT
1174 }
1175}
1176#[cfg_attr(feature = "ts", derive(TS))]
1177#[cfg_attr(feature = "ts", ts(export))]
1178#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1179#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1180#[cfg_attr(feature = "serde", serde(tag = "type"))]
1181#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1182#[repr(u32)]
1183pub enum MavArmAuthDeniedReason {
1184 #[doc = "Not a specific reason"]
1185 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1186 #[doc = "Authorizer will send the error as string to GCS"]
1187 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1188 #[doc = "At least one waypoint have a invalid value"]
1189 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1190 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1191 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1192 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1193 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1194 #[doc = "Weather is not good to fly"]
1195 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1196}
1197impl MavArmAuthDeniedReason {
1198 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1199}
1200impl Default for MavArmAuthDeniedReason {
1201 fn default() -> Self {
1202 Self::DEFAULT
1203 }
1204}
1205#[cfg_attr(feature = "ts", derive(TS))]
1206#[cfg_attr(feature = "ts", ts(export))]
1207#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1209#[cfg_attr(feature = "serde", serde(tag = "type"))]
1210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1211#[repr(u32)]
1212#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1213pub enum MavAutopilot {
1214 #[doc = "Generic autopilot, full support for everything"]
1215 MAV_AUTOPILOT_GENERIC = 0,
1216 #[doc = "Reserved for future use."]
1217 MAV_AUTOPILOT_RESERVED = 1,
1218 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1219 MAV_AUTOPILOT_SLUGS = 2,
1220 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1221 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1222 #[doc = "OpenPilot, <http://openpilot.org>"]
1223 MAV_AUTOPILOT_OPENPILOT = 4,
1224 #[doc = "Generic autopilot only supporting simple waypoints"]
1225 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1226 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1227 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1228 #[doc = "Generic autopilot supporting the full mission command set"]
1229 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1230 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1231 MAV_AUTOPILOT_INVALID = 8,
1232 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1233 MAV_AUTOPILOT_PPZ = 9,
1234 #[doc = "UAV Dev Board"]
1235 MAV_AUTOPILOT_UDB = 10,
1236 #[doc = "FlexiPilot"]
1237 MAV_AUTOPILOT_FP = 11,
1238 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1239 MAV_AUTOPILOT_PX4 = 12,
1240 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1241 MAV_AUTOPILOT_SMACCMPILOT = 13,
1242 #[doc = "AutoQuad -- <http://autoquad.org>"]
1243 MAV_AUTOPILOT_AUTOQUAD = 14,
1244 #[doc = "Armazila -- <http://armazila.com>"]
1245 MAV_AUTOPILOT_ARMAZILA = 15,
1246 #[doc = "Aerob -- <http://aerob.ru>"]
1247 MAV_AUTOPILOT_AEROB = 16,
1248 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1249 MAV_AUTOPILOT_ASLUAV = 17,
1250 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1251 MAV_AUTOPILOT_SMARTAP = 18,
1252 #[doc = "AirRails - <http://uaventure.com>"]
1253 MAV_AUTOPILOT_AIRRAILS = 19,
1254 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1255 MAV_AUTOPILOT_REFLEX = 20,
1256}
1257impl MavAutopilot {
1258 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1259}
1260impl Default for MavAutopilot {
1261 fn default() -> Self {
1262 Self::DEFAULT
1263 }
1264}
1265#[cfg_attr(feature = "ts", derive(TS))]
1266#[cfg_attr(feature = "ts", ts(export))]
1267#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1269#[cfg_attr(feature = "serde", serde(tag = "type"))]
1270#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1271#[repr(u32)]
1272#[doc = "Enumeration for battery charge states."]
1273pub enum MavBatteryChargeState {
1274 #[doc = "Low battery state is not provided"]
1275 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1276 #[doc = "Battery is not in low state. Normal operation."]
1277 MAV_BATTERY_CHARGE_STATE_OK = 1,
1278 #[doc = "Battery state is low, warn and monitor close."]
1279 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1280 #[doc = "Battery state is critical, return or abort immediately."]
1281 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1282 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1283 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1284 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1285 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1286 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1287 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1288 #[doc = "Battery is charging."]
1289 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1290}
1291impl MavBatteryChargeState {
1292 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1293}
1294impl Default for MavBatteryChargeState {
1295 fn default() -> Self {
1296 Self::DEFAULT
1297 }
1298}
1299bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1300impl MavBatteryFault {
1301 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1302}
1303impl Default for MavBatteryFault {
1304 fn default() -> Self {
1305 Self::DEFAULT
1306 }
1307}
1308#[cfg_attr(feature = "ts", derive(TS))]
1309#[cfg_attr(feature = "ts", ts(export))]
1310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1312#[cfg_attr(feature = "serde", serde(tag = "type"))]
1313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1314#[repr(u32)]
1315#[doc = "Enumeration of battery functions"]
1316pub enum MavBatteryFunction {
1317 #[doc = "Battery function is unknown"]
1318 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1319 #[doc = "Battery supports all flight systems"]
1320 MAV_BATTERY_FUNCTION_ALL = 1,
1321 #[doc = "Battery for the propulsion system"]
1322 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1323 #[doc = "Avionics battery"]
1324 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1325 #[doc = "Payload battery"]
1326 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1327}
1328impl MavBatteryFunction {
1329 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1330}
1331impl Default for MavBatteryFunction {
1332 fn default() -> Self {
1333 Self::DEFAULT
1334 }
1335}
1336#[cfg_attr(feature = "ts", derive(TS))]
1337#[cfg_attr(feature = "ts", ts(export))]
1338#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1340#[cfg_attr(feature = "serde", serde(tag = "type"))]
1341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1342#[repr(u32)]
1343#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1344pub enum MavBatteryMode {
1345 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1346 MAV_BATTERY_MODE_UNKNOWN = 0,
1347 #[doc = "Battery is auto discharging (towards storage level)."]
1348 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1349 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1350 MAV_BATTERY_MODE_HOT_SWAP = 2,
1351}
1352impl MavBatteryMode {
1353 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1354}
1355impl Default for MavBatteryMode {
1356 fn default() -> Self {
1357 Self::DEFAULT
1358 }
1359}
1360#[cfg_attr(feature = "ts", derive(TS))]
1361#[cfg_attr(feature = "ts", ts(export))]
1362#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1364#[cfg_attr(feature = "serde", serde(tag = "type"))]
1365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1366#[repr(u32)]
1367#[doc = "Enumeration of battery types"]
1368pub enum MavBatteryType {
1369 #[doc = "Not specified."]
1370 MAV_BATTERY_TYPE_UNKNOWN = 0,
1371 #[doc = "Lithium polymer battery"]
1372 MAV_BATTERY_TYPE_LIPO = 1,
1373 #[doc = "Lithium-iron-phosphate battery"]
1374 MAV_BATTERY_TYPE_LIFE = 2,
1375 #[doc = "Lithium-ION battery"]
1376 MAV_BATTERY_TYPE_LION = 3,
1377 #[doc = "Nickel metal hydride battery"]
1378 MAV_BATTERY_TYPE_NIMH = 4,
1379}
1380impl MavBatteryType {
1381 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1382}
1383impl Default for MavBatteryType {
1384 fn default() -> Self {
1385 Self::DEFAULT
1386 }
1387}
1388#[cfg_attr(feature = "ts", derive(TS))]
1389#[cfg_attr(feature = "ts", ts(export))]
1390#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1391#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1392#[cfg_attr(feature = "serde", serde(tag = "type"))]
1393#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1394#[repr(u32)]
1395#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1396pub enum MavCmd {
1397 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1398 #[doc = ""]
1399 #[doc = "# Parameters"]
1400 #[doc = ""]
1401 #[doc = "| Parameter | Description | Values | Units |"]
1402 #[doc = "| --------- | ----------- | ------ | ----- |"]
1403 #[doc = "| 1 (Hold) | Hold time. (ignored by fixed wing, time to stay at waypoint for rotary wing)| ≥ 0 | s |"]
1404 #[doc = "| 2 (Accept Radius)| Acceptance radius (if the sphere with this radius is hit, the waypoint counts as reached)| ≥ 0 | m |"]
1405 #[doc = "| 3 (Pass Radius)| 0 to pass through the WP, if>0 radius to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.| | m |"]
1406 #[doc = "| 4 (Yaw) | Desired yaw angle at waypoint (rotary wing). NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| | deg |"]
1407 #[doc = "| 5 (Latitude)| Latitude | | |"]
1408 #[doc = "| 6 (Longitude)| Longitude | | |"]
1409 #[doc = "| 7 (Altitude)| Altitude | | m |"]
1410 MAV_CMD_NAV_WAYPOINT = 16,
1411 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1412 #[doc = ""]
1413 #[doc = "# Parameters"]
1414 #[doc = ""]
1415 #[doc = "| Parameter | Description | Units |"]
1416 #[doc = "| --------- | ----------- | ----- |"]
1417 #[doc = "| 1 | Empty | |"]
1418 #[doc = "| 2 | Empty | |"]
1419 #[doc = "| 3 (Radius)| Loiter radius around waypoint for forward-only moving vehicles (not multicopters). If positive loiter clockwise, else counter-clockwise| m |"]
1420 #[doc = "| 4 (Yaw) | Desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| deg |"]
1421 #[doc = "| 5 (Latitude)| Latitude | |"]
1422 #[doc = "| 6 (Longitude)| Longitude | |"]
1423 #[doc = "| 7 (Altitude)| Altitude | m |"]
1424 MAV_CMD_NAV_LOITER_UNLIM = 17,
1425 #[doc = "Loiter around this waypoint for X turns"]
1426 #[doc = ""]
1427 #[doc = "# Parameters"]
1428 #[doc = ""]
1429 #[doc = "| Parameter | Description | Values | Units |"]
1430 #[doc = "| --------- | ----------- | ------ | ----- |"]
1431 #[doc = "| 1 (Turns) | Number of turns.| ≥ 0 | |"]
1432 #[doc = "| 2 (Heading Required)| Leave loiter circle only once heading towards the next waypoint (0 = False)| 0, 1 | |"]
1433 #[doc = "| 3 (Radius)| Loiter radius around waypoint for forward-only moving vehicles (not multicopters). If positive loiter clockwise, else counter-clockwise| | m |"]
1434 #[doc = "| 4 (Xtrack Location)| Loiter circle exit location and/or path to next waypoint (\"xtrack\") for forward-only moving vehicles (not multicopters). 0 for the vehicle to converge towards the center xtrack when it leaves the loiter (the line between the centers of the current and next waypoint), 1 to converge to the direct line between the location that the vehicle exits the loiter radius and the next waypoint. Otherwise the angle (in degrees) between the tangent of the loiter circle and the center xtrack at which the vehicle must leave the loiter (and converge to the center xtrack). NaN to use the current system default xtrack behaviour.| | |"]
1435 #[doc = "| 5 (Latitude)| Latitude | | |"]
1436 #[doc = "| 6 (Longitude)| Longitude | | |"]
1437 #[doc = "| 7 (Altitude)| Altitude | | m |"]
1438 MAV_CMD_NAV_LOITER_TURNS = 18,
1439 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1440 #[doc = ""]
1441 #[doc = "# Parameters"]
1442 #[doc = ""]
1443 #[doc = "| Parameter | Description | Values | Units |"]
1444 #[doc = "| --------- | ----------- | ------ | ----- |"]
1445 #[doc = "| 1 (Time) | Loiter time (only starts once Lat, Lon and Alt is reached).| ≥ 0 | s |"]
1446 #[doc = "| 2 (Heading Required)| Leave loiter circle only once heading towards the next waypoint (0 = False)| 0, 1 | |"]
1447 #[doc = "| 3 (Radius)| Loiter radius around waypoint for forward-only moving vehicles (not multicopters). If positive loiter clockwise, else counter-clockwise.| | m |"]
1448 #[doc = "| 4 (Xtrack Location)| Loiter circle exit location and/or path to next waypoint (\"xtrack\") for forward-only moving vehicles (not multicopters). 0 for the vehicle to converge towards the center xtrack when it leaves the loiter (the line between the centers of the current and next waypoint), 1 to converge to the direct line between the location that the vehicle exits the loiter radius and the next waypoint. Otherwise the angle (in degrees) between the tangent of the loiter circle and the center xtrack at which the vehicle must leave the loiter (and converge to the center xtrack). NaN to use the current system default xtrack behaviour.| | |"]
1449 #[doc = "| 5 (Latitude)| Latitude | | |"]
1450 #[doc = "| 6 (Longitude)| Longitude | | |"]
1451 #[doc = "| 7 (Altitude)| Altitude | | m |"]
1452 MAV_CMD_NAV_LOITER_TIME = 19,
1453 #[doc = "Return to launch location"]
1454 #[doc = ""]
1455 #[doc = "# Parameters"]
1456 #[doc = ""]
1457 #[doc = "| Parameter | Description |"]
1458 #[doc = "| --------- | ----------- |"]
1459 #[doc = "| 1 | Empty |"]
1460 #[doc = "| 2 | Empty |"]
1461 #[doc = "| 3 | Empty |"]
1462 #[doc = "| 4 | Empty |"]
1463 #[doc = "| 5 | Empty |"]
1464 #[doc = "| 6 | Empty |"]
1465 #[doc = "| 7 | Empty |"]
1466 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1467 #[doc = "Land at location."]
1468 #[doc = ""]
1469 #[doc = "# Parameters"]
1470 #[doc = ""]
1471 #[doc = "| Parameter | Description | Values | Units |"]
1472 #[doc = "| --------- | ----------- | ------ | ----- |"]
1473 #[doc = "| 1 (Abort Alt)| Minimum target altitude if landing is aborted (0 = undefined/use system default).| | m |"]
1474 #[doc = "| 2 (Land Mode)| Precision land mode.| [`PrecisionLandMode`] | |"]
1475 #[doc = "| 3 | Empty. | | |"]
1476 #[doc = "| 4 (Yaw Angle)| Desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| | deg |"]
1477 #[doc = "| 5 (Latitude)| Latitude. | | |"]
1478 #[doc = "| 6 (Longitude)| Longitude. | | |"]
1479 #[doc = "| 7 (Altitude)| Landing altitude (ground level in current frame).| | m |"]
1480 MAV_CMD_NAV_LAND = 21,
1481 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1482 #[doc = ""]
1483 #[doc = "# Parameters"]
1484 #[doc = ""]
1485 #[doc = "| Parameter | Description | Units |"]
1486 #[doc = "| --------- | ----------- | ----- |"]
1487 #[doc = "| 1 (Pitch) | Minimum pitch (if airspeed sensor present), desired pitch without sensor| deg |"]
1488 #[doc = "| 2 | Empty | |"]
1489 #[doc = "| 3 | Empty | |"]
1490 #[doc = "| 4 (Yaw) | Yaw angle (if magnetometer present), ignored without magnetometer. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| deg |"]
1491 #[doc = "| 5 (Latitude)| Latitude | |"]
1492 #[doc = "| 6 (Longitude)| Longitude | |"]
1493 #[doc = "| 7 (Altitude)| Altitude | m |"]
1494 MAV_CMD_NAV_TAKEOFF = 22,
1495 #[doc = "Land at local position (local frame only)"]
1496 #[doc = ""]
1497 #[doc = "# Parameters"]
1498 #[doc = ""]
1499 #[doc = "| Parameter | Description | Values | Units |"]
1500 #[doc = "| --------- | ----------- | ------ | ----- |"]
1501 #[doc = "| 1 (Target)| Landing target number (if available)| 0, 1, .. | |"]
1502 #[doc = "| 2 (Offset)| Maximum accepted offset from desired landing position - computed magnitude from spherical coordinates: d = sqrt(x^2 + y^2 + z^2), which gives the maximum accepted distance between the desired landing position and the position where the vehicle is about to land| ≥ 0 | m |"]
1503 #[doc = "| 3 (Descend Rate)| Landing descend rate| | m/s |"]
1504 #[doc = "| 4 (Yaw) | Desired yaw angle| | rad |"]
1505 #[doc = "| 5 (Y Position)| Y-axis position| | m |"]
1506 #[doc = "| 6 (X Position)| X-axis position| | m |"]
1507 #[doc = "| 7 (Z Position)| Z-axis / ground level position| | m |"]
1508 MAV_CMD_NAV_LAND_LOCAL = 23,
1509 #[doc = "Takeoff from local position (local frame only)"]
1510 #[doc = ""]
1511 #[doc = "# Parameters"]
1512 #[doc = ""]
1513 #[doc = "| Parameter | Description | Units |"]
1514 #[doc = "| --------- | ----------- | ----- |"]
1515 #[doc = "| 1 (Pitch) | Minimum pitch (if airspeed sensor present), desired pitch without sensor| rad |"]
1516 #[doc = "| 2 | Empty | |"]
1517 #[doc = "| 3 (Ascend Rate)| Takeoff ascend rate| m/s |"]
1518 #[doc = "| 4 (Yaw) | Yaw angle (if magnetometer or another yaw estimation source present), ignored without one of these| rad |"]
1519 #[doc = "| 5 (Y Position)| Y-axis position| m |"]
1520 #[doc = "| 6 (X Position)| X-axis position| m |"]
1521 #[doc = "| 7 (Z Position)| Z-axis position| m |"]
1522 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1523 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1524 #[doc = ""]
1525 #[doc = "# Parameters"]
1526 #[doc = ""]
1527 #[doc = "| Parameter | Description | Values | Units |"]
1528 #[doc = "| --------- | ----------- | ------ | ----- |"]
1529 #[doc = "| 1 (Following)| Following logic to use (e.g. loitering or sinusoidal following) - depends on specific autopilot implementation| Multiples of 1 | |"]
1530 #[doc = "| 2 (Ground Speed)| Ground speed of vehicle to be followed| | m/s |"]
1531 #[doc = "| 3 (Radius)| Radius around waypoint. If positive loiter clockwise, else counter-clockwise| | m |"]
1532 #[doc = "| 4 (Yaw) | Desired yaw angle.| | deg |"]
1533 #[doc = "| 5 (Latitude)| Latitude | | |"]
1534 #[doc = "| 6 (Longitude)| Longitude | | |"]
1535 #[doc = "| 7 (Altitude)| Altitude | | m |"]
1536 MAV_CMD_NAV_FOLLOW = 25,
1537 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1538 #[doc = ""]
1539 #[doc = "# Parameters"]
1540 #[doc = ""]
1541 #[doc = "| Parameter | Description | Values | Units |"]
1542 #[doc = "| --------- | ----------- | ------ | ----- |"]
1543 #[doc = "| 1 (Action)| Climb or Descend (0 = Neutral, command completes when within 5m of this command's altitude, 1 = Climbing, command completes when at or above this command's altitude, 2 = Descending, command completes when at or below this command's altitude.| 0, 1, 2 | |"]
1544 #[doc = "| 2 | Empty | | |"]
1545 #[doc = "| 3 | Empty | | |"]
1546 #[doc = "| 4 | Empty | | |"]
1547 #[doc = "| 5 | Empty | | |"]
1548 #[doc = "| 6 | Empty | | |"]
1549 #[doc = "| 7 (Altitude)| Desired altitude| | m |"]
1550 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1551 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1552 #[doc = ""]
1553 #[doc = "# Parameters"]
1554 #[doc = ""]
1555 #[doc = "| Parameter | Description | Values | Units |"]
1556 #[doc = "| --------- | ----------- | ------ | ----- |"]
1557 #[doc = "| 1 (Heading Required)| Leave loiter circle only once heading towards the next waypoint (0 = False)| 0, 1 | |"]
1558 #[doc = "| 2 (Radius)| Loiter radius around waypoint for forward-only moving vehicles (not multicopters). If positive loiter clockwise, negative counter-clockwise, 0 means no change to standard loiter.| | m |"]
1559 #[doc = "| 3 | Empty | | |"]
1560 #[doc = "| 4 (Xtrack Location)| Loiter circle exit location and/or path to next waypoint (\"xtrack\") for forward-only moving vehicles (not multicopters). 0 for the vehicle to converge towards the center xtrack when it leaves the loiter (the line between the centers of the current and next waypoint), 1 to converge to the direct line between the location that the vehicle exits the loiter radius and the next waypoint. Otherwise the angle (in degrees) between the tangent of the loiter circle and the center xtrack at which the vehicle must leave the loiter (and converge to the center xtrack). NaN to use the current system default xtrack behaviour.| 0, 1 | |"]
1561 #[doc = "| 5 (Latitude)| Latitude | | |"]
1562 #[doc = "| 6 (Longitude)| Longitude | | |"]
1563 #[doc = "| 7 (Altitude)| Altitude | | m |"]
1564 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1565 #[doc = "Begin following a target"]
1566 #[doc = ""]
1567 #[doc = "# Parameters"]
1568 #[doc = ""]
1569 #[doc = "| Parameter | Description | Values | Units |"]
1570 #[doc = "| --------- | ----------- | ------ | ----- |"]
1571 #[doc = "| 1 (System ID)| System ID (of the FOLLOW_TARGET beacon). Send 0 to disable follow-me and return to the default position hold mode.| 0, 1, .. , 255 | |"]
1572 #[doc = "| 2 | Reserved | | |"]
1573 #[doc = "| 3 | Reserved | | |"]
1574 #[doc = "| 4 (Altitude Mode)| Altitude mode: 0: Keep current altitude, 1: keep altitude difference to target, 2: go to a fixed altitude above home.| 0, 1, 2 | |"]
1575 #[doc = "| 5 (Altitude)| Altitude above home. (used if mode=2)| | m |"]
1576 #[doc = "| 6 | Reserved | | |"]
1577 #[doc = "| 7 (Time to Land)| Time to land in which the MAV should go to the default position hold mode after a message RX timeout.| ≥ 0 | s |"]
1578 MAV_CMD_DO_FOLLOW = 32,
1579 #[doc = "Reposition the MAV after a follow target command has been sent"]
1580 #[doc = ""]
1581 #[doc = "# Parameters"]
1582 #[doc = ""]
1583 #[doc = "| Parameter | Description | Units |"]
1584 #[doc = "| --------- | ----------- | ----- |"]
1585 #[doc = "| 1 (Camera Q1)| Camera q1 (where 0 is on the ray from the camera to the tracking device)| |"]
1586 #[doc = "| 2 (Camera Q2)| Camera q2 | |"]
1587 #[doc = "| 3 (Camera Q3)| Camera q3 | |"]
1588 #[doc = "| 4 (Camera Q4)| Camera q4 | |"]
1589 #[doc = "| 5 (Altitude Offset)| altitude offset from target| m |"]
1590 #[doc = "| 6 (X Offset)| X offset from target| m |"]
1591 #[doc = "| 7 (Y Offset)| Y offset from target| m |"]
1592 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1593 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1594 #[doc = ""]
1595 #[doc = "# Parameters"]
1596 #[doc = ""]
1597 #[doc = "| Parameter | Description | Values | Units |"]
1598 #[doc = "| --------- | ----------- | ------ | ----- |"]
1599 #[doc = "| 1 (Radius)| Radius of the circle. Positive: orbit clockwise. Negative: orbit counter-clockwise. NaN: Use vehicle default radius, or current radius if already orbiting.| | m |"]
1600 #[doc = "| 2 (Velocity)| Tangential Velocity. NaN: Use vehicle default velocity, or current velocity if already orbiting.| | m/s |"]
1601 #[doc = "| 3 (Yaw Behavior)| Yaw behavior of the vehicle.| [`OrbitYawBehaviour`] | |"]
1602 #[doc = "| 4 (Orbits)| Orbit around the centre point for this many radians (i.e. for a three-quarter orbit set 270*Pi/180). 0: Orbit forever. NaN: Use vehicle default, or current value if already orbiting.| ≥ 0 | rad |"]
1603 #[doc = "| 5 (Latitude/X)| Center point latitude (if no MAV_FRAME specified) / X coordinate according to MAV_FRAME. INT32_MAX (or NaN if sent in COMMAND_LONG): Use current vehicle position, or current center if already orbiting.| | |"]
1604 #[doc = "| 6 (Longitude/Y)| Center point longitude (if no MAV_FRAME specified) / Y coordinate according to MAV_FRAME. INT32_MAX (or NaN if sent in COMMAND_LONG): Use current vehicle position, or current center if already orbiting.| | |"]
1605 #[doc = "| 7 (Altitude/Z)| Center point altitude (MSL) (if no MAV_FRAME specified) / Z coordinate according to MAV_FRAME. NaN: Use current vehicle altitude.| | |"]
1606 MAV_CMD_DO_ORBIT = 34,
1607 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1608 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1609 #[doc = ""]
1610 #[doc = "# Parameters"]
1611 #[doc = ""]
1612 #[doc = "| Parameter | Description | Values |"]
1613 #[doc = "| --------- | ----------- | ------ |"]
1614 #[doc = "| 1 (ROI Mode)| Region of interest mode.| [`MavRoi`] |"]
1615 #[doc = "| 2 (WP Index)| Waypoint index/ target ID. (see MAV_ROI enum)| 0, 1, .. |"]
1616 #[doc = "| 3 (ROI Index)| ROI index (allows a vehicle to manage multiple ROI's)| 0, 1, .. |"]
1617 #[doc = "| 4 | Empty | |"]
1618 #[doc = "| 5 (X) | x the location of the fixed ROI (see MAV_FRAME)| |"]
1619 #[doc = "| 6 (Y) | y | |"]
1620 #[doc = "| 7 (Z) | z | |"]
1621 MAV_CMD_NAV_ROI = 80,
1622 #[doc = "Control autonomous path planning on the MAV."]
1623 #[doc = ""]
1624 #[doc = "# Parameters"]
1625 #[doc = ""]
1626 #[doc = "| Parameter | Description | Values | Units |"]
1627 #[doc = "| --------- | ----------- | ------ | ----- |"]
1628 #[doc = "| 1 (Local Ctrl)| 0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning| 0, 1, 2 | |"]
1629 #[doc = "| 2 (Global Ctrl)| 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid| 0, 1, .. , 3 | |"]
1630 #[doc = "| 3 | Empty | | |"]
1631 #[doc = "| 4 (Yaw) | Yaw angle at goal| | deg |"]
1632 #[doc = "| 5 (Latitude/X)| Latitude/X of goal| | |"]
1633 #[doc = "| 6 (Longitude/Y)| Longitude/Y of goal| | |"]
1634 #[doc = "| 7 (Altitude/Z)| Altitude/Z of goal| | |"]
1635 MAV_CMD_NAV_PATHPLANNING = 81,
1636 #[doc = "Navigate to waypoint using a spline path."]
1637 #[doc = ""]
1638 #[doc = "# Parameters"]
1639 #[doc = ""]
1640 #[doc = "| Parameter | Description | Values | Units |"]
1641 #[doc = "| --------- | ----------- | ------ | ----- |"]
1642 #[doc = "| 1 (Hold) | Hold time. (ignored by fixed wing, time to stay at waypoint for rotary wing)| ≥ 0 | s |"]
1643 #[doc = "| 2 | Empty | | |"]
1644 #[doc = "| 3 | Empty | | |"]
1645 #[doc = "| 4 | Empty | | |"]
1646 #[doc = "| 5 (Latitude/X)| Latitude/X of goal| | |"]
1647 #[doc = "| 6 (Longitude/Y)| Longitude/Y of goal| | |"]
1648 #[doc = "| 7 (Altitude/Z)| Altitude/Z of goal| | |"]
1649 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1650 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1651 #[doc = ""]
1652 #[doc = "# Parameters"]
1653 #[doc = ""]
1654 #[doc = "| Parameter | Description | Values | Units |"]
1655 #[doc = "| --------- | ----------- | ------ | ----- |"]
1656 #[doc = "| 1 | Empty | | |"]
1657 #[doc = "| 2 (Transition Heading)| Front transition heading.| [`VtolTransitionHeading`] | |"]
1658 #[doc = "| 3 | Empty | | |"]
1659 #[doc = "| 4 (Yaw Angle)| Yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| | deg |"]
1660 #[doc = "| 5 (Latitude)| Latitude | | |"]
1661 #[doc = "| 6 (Longitude)| Longitude | | |"]
1662 #[doc = "| 7 (Altitude)| Altitude | | m |"]
1663 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1664 #[doc = "Land using VTOL mode"]
1665 #[doc = ""]
1666 #[doc = "# Parameters"]
1667 #[doc = ""]
1668 #[doc = "| Parameter | Description | Values | Units |"]
1669 #[doc = "| --------- | ----------- | ------ | ----- |"]
1670 #[doc = "| 1 (Land Options)| Landing behaviour.| [`NavVtolLandOptions`] | |"]
1671 #[doc = "| 2 | Empty | | |"]
1672 #[doc = "| 3 (Approach Altitude)| Approach altitude (with the same reference as the Altitude field). NaN if unspecified.| | m |"]
1673 #[doc = "| 4 (Yaw) | Yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| | deg |"]
1674 #[doc = "| 5 (Latitude)| Latitude | | |"]
1675 #[doc = "| 6 (Longitude)| Longitude | | |"]
1676 #[doc = "| 7 (Ground Altitude)| Altitude (ground level) relative to the current coordinate frame. NaN to use system default landing altitude (ignore value).| | m |"]
1677 MAV_CMD_NAV_VTOL_LAND = 85,
1678 #[doc = "hand control over to an external controller"]
1679 #[doc = ""]
1680 #[doc = "# Parameters"]
1681 #[doc = ""]
1682 #[doc = "| Parameter | Description | Values |"]
1683 #[doc = "| --------- | ----------- | ------ |"]
1684 #[doc = "| 1 (Enable)| On / Off (>0.5f on)| 0, 1 |"]
1685 #[doc = "| 2 | Empty | |"]
1686 #[doc = "| 3 | Empty | |"]
1687 #[doc = "| 4 | Empty | |"]
1688 #[doc = "| 5 | Empty | |"]
1689 #[doc = "| 6 | Empty | |"]
1690 #[doc = "| 7 | Empty | |"]
1691 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1692 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1693 #[doc = ""]
1694 #[doc = "# Parameters"]
1695 #[doc = ""]
1696 #[doc = "| Parameter | Description | Values | Units |"]
1697 #[doc = "| --------- | ----------- | ------ | ----- |"]
1698 #[doc = "| 1 (Delay) | Delay (-1 to enable time-of-day fields)| -1, 0, .. | s |"]
1699 #[doc = "| 2 (Hour) | hour (24h format, UTC, -1 to ignore)| -1, 0, .. , 23 | |"]
1700 #[doc = "| 3 (Minute)| minute (24h format, UTC, -1 to ignore)| -1, 0, .. , 59 | |"]
1701 #[doc = "| 4 (Second)| second (24h format, UTC, -1 to ignore)| -1, 0, .. , 59 | |"]
1702 #[doc = "| 5 | Empty | | |"]
1703 #[doc = "| 6 | Empty | | |"]
1704 #[doc = "| 7 | Empty | | |"]
1705 MAV_CMD_NAV_DELAY = 93,
1706 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1707 #[doc = ""]
1708 #[doc = "# Parameters"]
1709 #[doc = ""]
1710 #[doc = "| Parameter | Description | Values | Units |"]
1711 #[doc = "| --------- | ----------- | ------ | ----- |"]
1712 #[doc = "| 1 (Max Descent)| Maximum distance to descend.| ≥ 0 | m |"]
1713 #[doc = "| 2 | Empty | | |"]
1714 #[doc = "| 3 | Empty | | |"]
1715 #[doc = "| 4 | Empty | | |"]
1716 #[doc = "| 5 (Latitude)| Latitude | | |"]
1717 #[doc = "| 6 (Longitude)| Longitude | | |"]
1718 #[doc = "| 7 (Altitude)| Altitude | | m |"]
1719 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1720 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1721 #[doc = ""]
1722 #[doc = "# Parameters"]
1723 #[doc = ""]
1724 #[doc = "| Parameter | Description |"]
1725 #[doc = "| --------- | ----------- |"]
1726 #[doc = "| 1 | Empty |"]
1727 #[doc = "| 2 | Empty |"]
1728 #[doc = "| 3 | Empty |"]
1729 #[doc = "| 4 | Empty |"]
1730 #[doc = "| 5 | Empty |"]
1731 #[doc = "| 6 | Empty |"]
1732 #[doc = "| 7 | Empty |"]
1733 MAV_CMD_NAV_LAST = 95,
1734 #[doc = "Delay mission state machine."]
1735 #[doc = ""]
1736 #[doc = "# Parameters"]
1737 #[doc = ""]
1738 #[doc = "| Parameter | Description | Values | Units |"]
1739 #[doc = "| --------- | ----------- | ------ | ----- |"]
1740 #[doc = "| 1 (Delay) | Delay | ≥ 0 | s |"]
1741 #[doc = "| 2 | Empty | | |"]
1742 #[doc = "| 3 | Empty | | |"]
1743 #[doc = "| 4 | Empty | | |"]
1744 #[doc = "| 5 | Empty | | |"]
1745 #[doc = "| 6 | Empty | | |"]
1746 #[doc = "| 7 | Empty | | |"]
1747 MAV_CMD_CONDITION_DELAY = 112,
1748 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1749 #[doc = ""]
1750 #[doc = "# Parameters"]
1751 #[doc = ""]
1752 #[doc = "| Parameter | Description | Units |"]
1753 #[doc = "| --------- | ----------- | ----- |"]
1754 #[doc = "| 1 (Rate) | Descent / Ascend rate.| m/s |"]
1755 #[doc = "| 2 | Empty | |"]
1756 #[doc = "| 3 | Empty | |"]
1757 #[doc = "| 4 | Empty | |"]
1758 #[doc = "| 5 | Empty | |"]
1759 #[doc = "| 6 | Empty | |"]
1760 #[doc = "| 7 (Altitude)| Target Altitude| m |"]
1761 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1762 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1763 #[doc = ""]
1764 #[doc = "# Parameters"]
1765 #[doc = ""]
1766 #[doc = "| Parameter | Description | Values | Units |"]
1767 #[doc = "| --------- | ----------- | ------ | ----- |"]
1768 #[doc = "| 1 (Distance)| Distance. | ≥ 0 | m |"]
1769 #[doc = "| 2 | Empty | | |"]
1770 #[doc = "| 3 | Empty | | |"]
1771 #[doc = "| 4 | Empty | | |"]
1772 #[doc = "| 5 | Empty | | |"]
1773 #[doc = "| 6 | Empty | | |"]
1774 #[doc = "| 7 | Empty | | |"]
1775 MAV_CMD_CONDITION_DISTANCE = 114,
1776 #[doc = "Reach a certain target angle."]
1777 #[doc = ""]
1778 #[doc = "# Parameters"]
1779 #[doc = ""]
1780 #[doc = "| Parameter | Description | Values | Units |"]
1781 #[doc = "| --------- | ----------- | ------ | ----- |"]
1782 #[doc = "| 1 (Angle) | target angle [0-360]. Absolute angles: 0 is north. Relative angle: 0 is initial yaw. Direction set by param3.| 0 .. 360 | deg |"]
1783 #[doc = "| 2 (Angular Speed)| angular speed| ≥ 0 | deg/s |"]
1784 #[doc = "| 3 (Direction)| direction: -1: counter clockwise, 0: shortest direction, 1: clockwise| -1, 0, 1 | |"]
1785 #[doc = "| 4 (Relative)| 0: absolute angle, 1: relative offset| 0, 1 | |"]
1786 #[doc = "| 5 | Empty | | |"]
1787 #[doc = "| 6 | Empty | | |"]
1788 #[doc = "| 7 | Empty | | |"]
1789 MAV_CMD_CONDITION_YAW = 115,
1790 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1791 #[doc = ""]
1792 #[doc = "# Parameters"]
1793 #[doc = ""]
1794 #[doc = "| Parameter | Description |"]
1795 #[doc = "| --------- | ----------- |"]
1796 #[doc = "| 1 | Empty |"]
1797 #[doc = "| 2 | Empty |"]
1798 #[doc = "| 3 | Empty |"]
1799 #[doc = "| 4 | Empty |"]
1800 #[doc = "| 5 | Empty |"]
1801 #[doc = "| 6 | Empty |"]
1802 #[doc = "| 7 | Empty |"]
1803 MAV_CMD_CONDITION_LAST = 159,
1804 #[doc = "Set system mode."]
1805 #[doc = ""]
1806 #[doc = "# Parameters"]
1807 #[doc = ""]
1808 #[doc = "| Parameter | Description | Values |"]
1809 #[doc = "| --------- | ----------- | ------ |"]
1810 #[doc = "| 1 (Mode) | Mode | [`MavMode`] |"]
1811 #[doc = "| 2 (Custom Mode)| Custom mode - this is system specific, please refer to the individual autopilot specifications for details.| |"]
1812 #[doc = "| 3 (Custom Submode)| Custom sub mode - this is system specific, please refer to the individual autopilot specifications for details.| |"]
1813 #[doc = "| 4 | Empty | |"]
1814 #[doc = "| 5 | Empty | |"]
1815 #[doc = "| 6 | Empty | |"]
1816 #[doc = "| 7 | Empty | |"]
1817 MAV_CMD_DO_SET_MODE = 176,
1818 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1819 #[doc = ""]
1820 #[doc = "# Parameters"]
1821 #[doc = ""]
1822 #[doc = "| Parameter | Description | Values |"]
1823 #[doc = "| --------- | ----------- | ------ |"]
1824 #[doc = "| 1 (Number)| Sequence number| 0, 1, .. |"]
1825 #[doc = "| 2 (Repeat)| Repeat count| 0, 1, .. |"]
1826 #[doc = "| 3 | Empty | |"]
1827 #[doc = "| 4 | Empty | |"]
1828 #[doc = "| 5 | Empty | |"]
1829 #[doc = "| 6 | Empty | |"]
1830 #[doc = "| 7 | Empty | |"]
1831 MAV_CMD_DO_JUMP = 177,
1832 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1833 #[doc = ""]
1834 #[doc = "# Parameters"]
1835 #[doc = ""]
1836 #[doc = "| Parameter | Description | Values | Units |"]
1837 #[doc = "| --------- | ----------- | ------ | ----- |"]
1838 #[doc = "| 1 (Speed Type)| Speed type of value set in param2 (such as airspeed, ground speed, and so on)| [`SpeedType`] | |"]
1839 #[doc = "| 2 (Speed) | Speed (-1 indicates no change, -2 indicates return to default vehicle speed)| ≥ -2 | m/s |"]
1840 #[doc = "| 3 (Throttle)| Throttle (-1 indicates no change, -2 indicates return to default vehicle throttle value)| ≥ -2 | % |"]
1841 #[doc = "| 4 | | Reserved (use 0) | |"]
1842 #[doc = "| 5 | | Reserved (use 0) | |"]
1843 #[doc = "| 6 | | Reserved (use 0) | |"]
1844 #[doc = "| 7 | | Reserved (use 0) | |"]
1845 MAV_CMD_DO_CHANGE_SPEED = 178,
1846 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1847 #[doc = ""]
1848 #[doc = "# Parameters"]
1849 #[doc = ""]
1850 #[doc = "| Parameter | Description | Values | Units |"]
1851 #[doc = "| --------- | ----------- | ------ | ----- |"]
1852 #[doc = "| 1 (Use Current)| Use current (1=use current location, 0=use specified location)| 0, 1 | |"]
1853 #[doc = "| 2 (Roll) | Roll angle (of surface). Range: -180..180 degrees. NAN or 0 means value not set. 0.01 indicates zero roll.| -180 .. 180 | deg |"]
1854 #[doc = "| 3 (Pitch) | Pitch angle (of surface). Range: -90..90 degrees. NAN or 0 means value not set. 0.01 means zero pitch.| -90 .. 90 | deg |"]
1855 #[doc = "| 4 (Yaw) | Yaw angle. NaN to use default heading. Range: -180..180 degrees.| -180 .. 180 | deg |"]
1856 #[doc = "| 5 (Latitude)| Latitude | | |"]
1857 #[doc = "| 6 (Longitude)| Longitude | | |"]
1858 #[doc = "| 7 (Altitude)| Altitude | | m |"]
1859 MAV_CMD_DO_SET_HOME = 179,
1860 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1861 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1862 #[doc = ""]
1863 #[doc = "# Parameters"]
1864 #[doc = ""]
1865 #[doc = "| Parameter | Description | Values |"]
1866 #[doc = "| --------- | ----------- | ------ |"]
1867 #[doc = "| 1 (Number)| Parameter number| 0, 1, .. |"]
1868 #[doc = "| 2 (Value) | Parameter value| |"]
1869 #[doc = "| 3 | Empty | |"]
1870 #[doc = "| 4 | Empty | |"]
1871 #[doc = "| 5 | Empty | |"]
1872 #[doc = "| 6 | Empty | |"]
1873 #[doc = "| 7 | Empty | |"]
1874 MAV_CMD_DO_SET_PARAMETER = 180,
1875 #[doc = "Set a relay to a condition."]
1876 #[doc = ""]
1877 #[doc = "# Parameters"]
1878 #[doc = ""]
1879 #[doc = "| Parameter | Description | Values |"]
1880 #[doc = "| --------- | ----------- | ------ |"]
1881 #[doc = "| 1 (Instance)| Relay instance number.| 0, 1, .. |"]
1882 #[doc = "| 2 (Setting)| Setting. (1=on, 0=off, others possible depending on system hardware)| 0, 1, .. |"]
1883 #[doc = "| 3 | Empty | |"]
1884 #[doc = "| 4 | Empty | |"]
1885 #[doc = "| 5 | Empty | |"]
1886 #[doc = "| 6 | Empty | |"]
1887 #[doc = "| 7 | Empty | |"]
1888 MAV_CMD_DO_SET_RELAY = 181,
1889 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1890 #[doc = ""]
1891 #[doc = "# Parameters"]
1892 #[doc = ""]
1893 #[doc = "| Parameter | Description | Values | Units |"]
1894 #[doc = "| --------- | ----------- | ------ | ----- |"]
1895 #[doc = "| 1 (Instance)| Relay instance number.| 0, 1, .. | |"]
1896 #[doc = "| 2 (Count) | Cycle count.| 1, 2, .. | |"]
1897 #[doc = "| 3 (Time) | Cycle time. | ≥ 0 | s |"]
1898 #[doc = "| 4 | Empty | | |"]
1899 #[doc = "| 5 | Empty | | |"]
1900 #[doc = "| 6 | Empty | | |"]
1901 #[doc = "| 7 | Empty | | |"]
1902 MAV_CMD_DO_REPEAT_RELAY = 182,
1903 #[doc = "Set a servo to a desired PWM value."]
1904 #[doc = ""]
1905 #[doc = "# Parameters"]
1906 #[doc = ""]
1907 #[doc = "| Parameter | Description | Values | Units |"]
1908 #[doc = "| --------- | ----------- | ------ | ----- |"]
1909 #[doc = "| 1 (Instance)| Servo instance number.| 0, 1, .. | |"]
1910 #[doc = "| 2 (PWM) | Pulse Width Modulation.| 0, 1, .. | us |"]
1911 #[doc = "| 3 | Empty | | |"]
1912 #[doc = "| 4 | Empty | | |"]
1913 #[doc = "| 5 | Empty | | |"]
1914 #[doc = "| 6 | Empty | | |"]
1915 #[doc = "| 7 | Empty | | |"]
1916 MAV_CMD_DO_SET_SERVO = 183,
1917 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1918 #[doc = ""]
1919 #[doc = "# Parameters"]
1920 #[doc = ""]
1921 #[doc = "| Parameter | Description | Values | Units |"]
1922 #[doc = "| --------- | ----------- | ------ | ----- |"]
1923 #[doc = "| 1 (Instance)| Servo instance number.| 0, 1, .. | |"]
1924 #[doc = "| 2 (PWM) | Pulse Width Modulation.| 0, 1, .. | us |"]
1925 #[doc = "| 3 (Count) | Cycle count.| 1, 2, .. | |"]
1926 #[doc = "| 4 (Time) | Cycle time. | ≥ 0 | s |"]
1927 #[doc = "| 5 | Empty | | |"]
1928 #[doc = "| 6 | Empty | | |"]
1929 #[doc = "| 7 | Empty | | |"]
1930 MAV_CMD_DO_REPEAT_SERVO = 184,
1931 #[doc = "Terminate flight immediately. Flight termination immediately and irreversibly terminates the current flight, returning the vehicle to ground. The vehicle will ignore RC or other input until it has been power-cycled. Termination may trigger safety measures, including: disabling motors and deployment of parachute on multicopters, and setting flight surfaces to initiate a landing pattern on fixed-wing). On multicopters without a parachute it may trigger a crash landing. Support for this command can be tested using the protocol bit: MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION. Support for this command can also be tested by sending the command with param1=0 (<0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1932 #[doc = ""]
1933 #[doc = "# Parameters"]
1934 #[doc = ""]
1935 #[doc = "| Parameter | Description | Values |"]
1936 #[doc = "| --------- | ----------- | ------ |"]
1937 #[doc = "| 1 (Terminate)| Flight termination activated if>0.5. Otherwise not activated and ACK with MAV_RESULT_FAILED.| 0, 1 |"]
1938 #[doc = "| 2 | Empty | |"]
1939 #[doc = "| 3 | Empty | |"]
1940 #[doc = "| 4 | Empty | |"]
1941 #[doc = "| 5 | Empty | |"]
1942 #[doc = "| 6 | Empty | |"]
1943 #[doc = "| 7 | Empty | |"]
1944 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1945 #[doc = "Change altitude set point."]
1946 #[doc = ""]
1947 #[doc = "# Parameters"]
1948 #[doc = ""]
1949 #[doc = "| Parameter | Description | Values | Units |"]
1950 #[doc = "| --------- | ----------- | ------ | ----- |"]
1951 #[doc = "| 1 (Altitude)| Altitude. | | m |"]
1952 #[doc = "| 2 (Frame) | Frame of new altitude.| [`MavFrame`] | |"]
1953 #[doc = "| 3 | Empty | | |"]
1954 #[doc = "| 4 | Empty | | |"]
1955 #[doc = "| 5 | Empty | | |"]
1956 #[doc = "| 6 | Empty | | |"]
1957 #[doc = "| 7 | Empty | | |"]
1958 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1959 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1960 #[doc = ""]
1961 #[doc = "# Parameters"]
1962 #[doc = ""]
1963 #[doc = "| Parameter | Description | Values |"]
1964 #[doc = "| --------- | ----------- | ------ |"]
1965 #[doc = "| 1 (Actuator 1)| Actuator 1 value, scaled from [-1 to 1]. NaN to ignore.| -1 .. 1 |"]
1966 #[doc = "| 2 (Actuator 2)| Actuator 2 value, scaled from [-1 to 1]. NaN to ignore.| -1 .. 1 |"]
1967 #[doc = "| 3 (Actuator 3)| Actuator 3 value, scaled from [-1 to 1]. NaN to ignore.| -1 .. 1 |"]
1968 #[doc = "| 4 (Actuator 4)| Actuator 4 value, scaled from [-1 to 1]. NaN to ignore.| -1 .. 1 |"]
1969 #[doc = "| 5 (Actuator 5)| Actuator 5 value, scaled from [-1 to 1]. NaN to ignore.| -1 .. 1 |"]
1970 #[doc = "| 6 (Actuator 6)| Actuator 6 value, scaled from [-1 to 1]. NaN to ignore.| -1 .. 1 |"]
1971 #[doc = "| 7 (Index) | Index of actuator set (i.e if set to 1, Actuator 1 becomes Actuator 7)| 0, 1, .. |"]
1972 MAV_CMD_DO_SET_ACTUATOR = 187,
1973 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1974 #[doc = ""]
1975 #[doc = "# Parameters"]
1976 #[doc = ""]
1977 #[doc = "| Parameter | Description | Units |"]
1978 #[doc = "| --------- | ----------- | ----- |"]
1979 #[doc = "| 1 | Empty | |"]
1980 #[doc = "| 2 | Empty | |"]
1981 #[doc = "| 3 | Empty | |"]
1982 #[doc = "| 4 | Empty | |"]
1983 #[doc = "| 5 (Latitude)| Latitudee. 0: not used.| |"]
1984 #[doc = "| 6 (Longitude)| Longitudee. 0: not used.| |"]
1985 #[doc = "| 7 (Altitude)| Altitudee. 0: not used.| m |"]
1986 MAV_CMD_DO_RETURN_PATH_START = 188,
1987 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1988 #[doc = ""]
1989 #[doc = "# Parameters"]
1990 #[doc = ""]
1991 #[doc = "| Parameter | Description | Units |"]
1992 #[doc = "| --------- | ----------- | ----- |"]
1993 #[doc = "| 1 | Empty | |"]
1994 #[doc = "| 2 | Empty | |"]
1995 #[doc = "| 3 | Empty | |"]
1996 #[doc = "| 4 | Empty | |"]
1997 #[doc = "| 5 (Latitude)| Latitude for landing sequence selection, or 0 (see description). Ignored in commands (set 0).| |"]
1998 #[doc = "| 6 (Longitude)| Longitude for landing sequence selection, or 0 (see description). Ignored in commands (set 0).| |"]
1999 #[doc = "| 7 (Altitude)| Altitude for landing sequence selection, or 0 (see description). Ignored in commands (set 0).| m |"]
2000 MAV_CMD_DO_LAND_START = 189,
2001 #[doc = "Mission command to perform a landing from a rally point."]
2002 #[doc = ""]
2003 #[doc = "# Parameters"]
2004 #[doc = ""]
2005 #[doc = "| Parameter | Description | Units |"]
2006 #[doc = "| --------- | ----------- | ----- |"]
2007 #[doc = "| 1 (Altitude)| Break altitude| m |"]
2008 #[doc = "| 2 (Speed) | Landing speed| m/s |"]
2009 #[doc = "| 3 | Empty | |"]
2010 #[doc = "| 4 | Empty | |"]
2011 #[doc = "| 5 | Empty | |"]
2012 #[doc = "| 6 | Empty | |"]
2013 #[doc = "| 7 | Empty | |"]
2014 MAV_CMD_DO_RALLY_LAND = 190,
2015 #[doc = "Mission command to safely abort an autonomous landing."]
2016 #[doc = ""]
2017 #[doc = "# Parameters"]
2018 #[doc = ""]
2019 #[doc = "| Parameter | Description | Units |"]
2020 #[doc = "| --------- | ----------- | ----- |"]
2021 #[doc = "| 1 (Altitude)| Altitude | m |"]
2022 #[doc = "| 2 | Empty | |"]
2023 #[doc = "| 3 | Empty | |"]
2024 #[doc = "| 4 | Empty | |"]
2025 #[doc = "| 5 | Empty | |"]
2026 #[doc = "| 6 | Empty | |"]
2027 #[doc = "| 7 | Empty | |"]
2028 MAV_CMD_DO_GO_AROUND = 191,
2029 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
2030 #[doc = ""]
2031 #[doc = "# Parameters"]
2032 #[doc = ""]
2033 #[doc = "| Parameter | Description | Values | Units |"]
2034 #[doc = "| --------- | ----------- | ------ | ----- |"]
2035 #[doc = "| 1 (Speed) | Ground speed, less than 0 (-1) for default| ≥ -1 | m/s |"]
2036 #[doc = "| 2 (Bitmask)| Bitmask of option flags.| [`MavDoRepositionFlags`] | |"]
2037 #[doc = "| 3 (Radius)| Loiter radius for planes. Positive values only, direction is controlled by Yaw value. A value of zero or NaN is ignored.| | m |"]
2038 #[doc = "| 4 (Yaw) | Yaw heading. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.). For planes indicates loiter direction (0: clockwise, 1: counter clockwise)| | rad |"]
2039 #[doc = "| 5 (Latitude)| Latitude | | |"]
2040 #[doc = "| 6 (Longitude)| Longitude | | |"]
2041 #[doc = "| 7 (Altitude)| Altitude | | m |"]
2042 MAV_CMD_DO_REPOSITION = 192,
2043 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
2044 #[doc = ""]
2045 #[doc = "# Parameters"]
2046 #[doc = ""]
2047 #[doc = "| Parameter | Description | Values |"]
2048 #[doc = "| --------- | ----------- | ------ |"]
2049 #[doc = "| 1 (Continue)| 0: Pause current mission or reposition command, hold current position. 1: Continue mission. A VTOL capable vehicle should enter hover mode (multicopter and VTOL planes). A plane should loiter with the default loiter radius.| 0, 1 |"]
2050 #[doc = "| 2 | Reserved | |"]
2051 #[doc = "| 3 | Reserved | |"]
2052 #[doc = "| 4 | Reserved | |"]
2053 #[doc = "| 5 | Reserved | |"]
2054 #[doc = "| 6 | Reserved | |"]
2055 #[doc = "| 7 | Reserved | |"]
2056 MAV_CMD_DO_PAUSE_CONTINUE = 193,
2057 #[doc = "Set moving direction to forward or reverse."]
2058 #[doc = ""]
2059 #[doc = "# Parameters"]
2060 #[doc = ""]
2061 #[doc = "| Parameter | Description | Values |"]
2062 #[doc = "| --------- | ----------- | ------ |"]
2063 #[doc = "| 1 (Reverse)| Direction (0=Forward, 1=Reverse)| 0, 1 |"]
2064 #[doc = "| 2 | Empty | |"]
2065 #[doc = "| 3 | Empty | |"]
2066 #[doc = "| 4 | Empty | |"]
2067 #[doc = "| 5 | Empty | |"]
2068 #[doc = "| 6 | Empty | |"]
2069 #[doc = "| 7 | Empty | |"]
2070 MAV_CMD_DO_SET_REVERSE = 194,
2071 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
2072 #[doc = ""]
2073 #[doc = "# Parameters"]
2074 #[doc = ""]
2075 #[doc = "| Parameter | Description | Units |"]
2076 #[doc = "| --------- | ----------- | ----- |"]
2077 #[doc = "| 1 (Gimbal device ID)| Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals).| |"]
2078 #[doc = "| 2 | Empty | |"]
2079 #[doc = "| 3 | Empty | |"]
2080 #[doc = "| 4 | Empty | |"]
2081 #[doc = "| 5 (Latitude)| Latitude of ROI location| degE7 |"]
2082 #[doc = "| 6 (Longitude)| Longitude of ROI location| degE7 |"]
2083 #[doc = "| 7 (Altitude)| Altitude of ROI location| m |"]
2084 MAV_CMD_DO_SET_ROI_LOCATION = 195,
2085 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
2086 #[doc = ""]
2087 #[doc = "# Parameters"]
2088 #[doc = ""]
2089 #[doc = "| Parameter | Description | Units |"]
2090 #[doc = "| --------- | ----------- | ----- |"]
2091 #[doc = "| 1 (Gimbal device ID)| Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals).| |"]
2092 #[doc = "| 2 | Empty | |"]
2093 #[doc = "| 3 | Empty | |"]
2094 #[doc = "| 4 | Empty | |"]
2095 #[doc = "| 5 (Pitch Offset)| Pitch offset from next waypoint, positive pitching up| deg |"]
2096 #[doc = "| 6 (Roll Offset)| Roll offset from next waypoint, positive rolling to the right| deg |"]
2097 #[doc = "| 7 (Yaw Offset)| Yaw offset from next waypoint, positive yawing to the right| deg |"]
2098 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
2099 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
2100 #[doc = ""]
2101 #[doc = "# Parameters"]
2102 #[doc = ""]
2103 #[doc = "| Parameter | Description |"]
2104 #[doc = "| --------- | ----------- |"]
2105 #[doc = "| 1 (Gimbal device ID)| Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals).|"]
2106 #[doc = "| 2 | Empty |"]
2107 #[doc = "| 3 | Empty |"]
2108 #[doc = "| 4 | Empty |"]
2109 #[doc = "| 5 | Empty |"]
2110 #[doc = "| 6 | Empty |"]
2111 #[doc = "| 7 | Empty |"]
2112 MAV_CMD_DO_SET_ROI_NONE = 197,
2113 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
2114 #[doc = ""]
2115 #[doc = "# Parameters"]
2116 #[doc = ""]
2117 #[doc = "| Parameter | Description | Values |"]
2118 #[doc = "| --------- | ----------- | ------ |"]
2119 #[doc = "| 1 (System ID)| System ID | 1, 2, .. , 255 |"]
2120 #[doc = "| 2 (Gimbal device ID)| Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals).| |"]
2121 MAV_CMD_DO_SET_ROI_SYSID = 198,
2122 #[doc = "Control onboard camera system."]
2123 #[doc = ""]
2124 #[doc = "# Parameters"]
2125 #[doc = ""]
2126 #[doc = "| Parameter | Description | Values | Units |"]
2127 #[doc = "| --------- | ----------- | ------ | ----- |"]
2128 #[doc = "| 1 (ID) | Camera ID (-1 for all)| -1, 0, .. | |"]
2129 #[doc = "| 2 (Transmission)| Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw| 0, 1, 2 | |"]
2130 #[doc = "| 3 (Interval)| Transmission mode: 0: video stream,>0: single images every n seconds| ≥ 0 | s |"]
2131 #[doc = "| 4 (Recording)| Recording: 0: disabled, 1: enabled compressed, 2: enabled raw| 0, 1, 2 | |"]
2132 #[doc = "| 5 | Empty | | |"]
2133 #[doc = "| 6 | Empty | | |"]
2134 #[doc = "| 7 | Empty | | |"]
2135 MAV_CMD_DO_CONTROL_VIDEO = 200,
2136 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
2137 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
2138 #[doc = ""]
2139 #[doc = "# Parameters"]
2140 #[doc = ""]
2141 #[doc = "| Parameter | Description | Values |"]
2142 #[doc = "| --------- | ----------- | ------ |"]
2143 #[doc = "| 1 (ROI Mode)| Region of interest mode.| [`MavRoi`] |"]
2144 #[doc = "| 2 (WP Index)| Waypoint index/ target ID (depends on param 1).| 0, 1, .. |"]
2145 #[doc = "| 3 (ROI Index)| Region of interest index. (allows a vehicle to manage multiple ROI's)| 0, 1, .. |"]
2146 #[doc = "| 4 | Empty | |"]
2147 #[doc = "| 5 | MAV_ROI_WPNEXT: pitch offset from next waypoint, MAV_ROI_LOCATION: latitude| |"]
2148 #[doc = "| 6 | MAV_ROI_WPNEXT: roll offset from next waypoint, MAV_ROI_LOCATION: longitude| |"]
2149 #[doc = "| 7 | MAV_ROI_WPNEXT: yaw offset from next waypoint, MAV_ROI_LOCATION: altitude| |"]
2150 MAV_CMD_DO_SET_ROI = 201,
2151 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
2152 #[doc = ""]
2153 #[doc = "# Parameters"]
2154 #[doc = ""]
2155 #[doc = "| Parameter | Description | Values | Units |"]
2156 #[doc = "| --------- | ----------- | ------ | ----- |"]
2157 #[doc = "| 1 (Mode) | Modes: P, TV, AV, M, Etc.| 0, 1, .. | |"]
2158 #[doc = "| 2 (Shutter Speed)| Shutter speed: Divisor number for one second.| 0, 1, .. | |"]
2159 #[doc = "| 3 (Aperture)| Aperture: F stop number.| ≥ 0 | |"]
2160 #[doc = "| 4 (ISO) | ISO number e.g. 80, 100, 200, Etc.| 0, 1, .. | |"]
2161 #[doc = "| 5 (Exposure)| Exposure type enumerator.| | |"]
2162 #[doc = "| 6 (Command Identity)| Command Identity.| | |"]
2163 #[doc = "| 7 (Engine Cut-off)| Main engine cut-off time before camera trigger. (0 means no cut-off)| 0, 1, .. | ds |"]
2164 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
2165 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
2166 #[doc = ""]
2167 #[doc = "# Parameters"]
2168 #[doc = ""]
2169 #[doc = "| Parameter | Description |"]
2170 #[doc = "| --------- | ----------- |"]
2171 #[doc = "| 1 (Session Control)| Session control e.g. show/hide lens|"]
2172 #[doc = "| 2 (Zoom Absolute)| Zoom's absolute position|"]
2173 #[doc = "| 3 (Zoom Relative)| Zooming step value to offset zoom from the current position|"]
2174 #[doc = "| 4 (Focus) | Focus Locking, Unlocking or Re-locking|"]
2175 #[doc = "| 5 (Shoot Command)| Shooting Command|"]
2176 #[doc = "| 6 (Command Identity)| Command Identity|"]
2177 #[doc = "| 7 (Shot ID)| Test shot identifier. If set to 1, image will only be captured, but not counted towards internal frame count.|"]
2178 MAV_CMD_DO_DIGICAM_CONTROL = 203,
2179 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
2180 #[doc = "Mission command to configure a camera or antenna mount"]
2181 #[doc = ""]
2182 #[doc = "# Parameters"]
2183 #[doc = ""]
2184 #[doc = "| Parameter | Description | Values |"]
2185 #[doc = "| --------- | ----------- | ------ |"]
2186 #[doc = "| 1 (Mode) | Mount operation mode| [`MavMountMode`] |"]
2187 #[doc = "| 2 (Stabilize Roll)| stabilize roll? (1 = yes, 0 = no)| 0, 1 |"]
2188 #[doc = "| 3 (Stabilize Pitch)| stabilize pitch? (1 = yes, 0 = no)| 0, 1 |"]
2189 #[doc = "| 4 (Stabilize Yaw)| stabilize yaw? (1 = yes, 0 = no)| 0, 1 |"]
2190 #[doc = "| 5 (Roll Input Mode)| roll input (0 = angle body frame, 1 = angular rate, 2 = angle absolute frame)| |"]
2191 #[doc = "| 6 (Pitch Input Mode)| pitch input (0 = angle body frame, 1 = angular rate, 2 = angle absolute frame)| |"]
2192 #[doc = "| 7 (Yaw Input Mode)| yaw input (0 = angle body frame, 1 = angular rate, 2 = angle absolute frame)| |"]
2193 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
2194 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
2195 #[doc = "Mission command to control a camera or antenna mount"]
2196 #[doc = ""]
2197 #[doc = "# Parameters"]
2198 #[doc = ""]
2199 #[doc = "| Parameter | Description | Values | Units |"]
2200 #[doc = "| --------- | ----------- | ------ | ----- |"]
2201 #[doc = "| 1 (Pitch) | pitch depending on mount mode (degrees or degrees/second depending on pitch input).| | |"]
2202 #[doc = "| 2 (Roll) | roll depending on mount mode (degrees or degrees/second depending on roll input).| | |"]
2203 #[doc = "| 3 (Yaw) | yaw depending on mount mode (degrees or degrees/second depending on yaw input).| | |"]
2204 #[doc = "| 4 (Altitude)| altitude depending on mount mode.| | m |"]
2205 #[doc = "| 5 (Latitude)| latitude, set if appropriate mount mode.| | |"]
2206 #[doc = "| 6 (Longitude)| longitude, set if appropriate mount mode.| | |"]
2207 #[doc = "| 7 (Mode) | Mount mode. | [`MavMountMode`] | |"]
2208 MAV_CMD_DO_MOUNT_CONTROL = 205,
2209 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
2210 #[doc = ""]
2211 #[doc = "# Parameters"]
2212 #[doc = ""]
2213 #[doc = "| Parameter | Description | Values | Units |"]
2214 #[doc = "| --------- | ----------- | ------ | ----- |"]
2215 #[doc = "| 1 (Distance)| Camera trigger distance. 0 to stop triggering.| ≥ 0 | m |"]
2216 #[doc = "| 2 (Shutter)| Camera shutter integration time. -1 or 0 to ignore| -1, 0, .. | ms |"]
2217 #[doc = "| 3 (Trigger)| Trigger camera once immediately. (0 = no trigger, 1 = trigger)| 0, 1 | |"]
2218 #[doc = "| 4 (Target Camera ID)| Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras attached to the autopilot, which don't have a distinct component id. 0: all cameras. This is used to target specific autopilot-connected cameras. It is also used to target specific cameras when the MAV_CMD is used in a mission.| 0, 1, .. , 255 | |"]
2219 #[doc = "| 5 | Empty | | |"]
2220 #[doc = "| 6 | Empty | | |"]
2221 #[doc = "| 7 | Empty | | |"]
2222 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
2223 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
2224 #[doc = ""]
2225 #[doc = "# Parameters"]
2226 #[doc = ""]
2227 #[doc = "| Parameter | Description | Values |"]
2228 #[doc = "| --------- | ----------- | ------ |"]
2229 #[doc = "| 1 (Enable)| enable? (0=disable, 1=enable, 2=disable_floor_only)| 0, 1, 2 |"]
2230 #[doc = "| 2 (Types) | Fence types to enable or disable as a bitmask. 0: field is unused/all fences should be enabled or disabled (for compatiblity reasons). Parameter is ignored if param1=2.| [`FenceType`] |"]
2231 #[doc = "| 3 | Empty | |"]
2232 #[doc = "| 4 | Empty | |"]
2233 #[doc = "| 5 | Empty | |"]
2234 #[doc = "| 6 | Empty | |"]
2235 #[doc = "| 7 | Empty | |"]
2236 MAV_CMD_DO_FENCE_ENABLE = 207,
2237 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
2238 #[doc = ""]
2239 #[doc = "# Parameters"]
2240 #[doc = ""]
2241 #[doc = "| Parameter | Description | Values |"]
2242 #[doc = "| --------- | ----------- | ------ |"]
2243 #[doc = "| 1 (Action)| Action | [`ParachuteAction`] |"]
2244 #[doc = "| 2 | Empty | |"]
2245 #[doc = "| 3 | Empty | |"]
2246 #[doc = "| 4 | Empty | |"]
2247 #[doc = "| 5 | Empty | |"]
2248 #[doc = "| 6 | Empty | |"]
2249 #[doc = "| 7 | Empty | |"]
2250 MAV_CMD_DO_PARACHUTE = 208,
2251 #[doc = "Command to perform motor test."]
2252 #[doc = ""]
2253 #[doc = "# Parameters"]
2254 #[doc = ""]
2255 #[doc = "| Parameter | Description | Values | Units |"]
2256 #[doc = "| --------- | ----------- | ------ | ----- |"]
2257 #[doc = "| 1 (Instance)| Motor instance number (from 1 to max number of motors on the vehicle).| 1, 2, .. | |"]
2258 #[doc = "| 2 (Throttle Type)| Throttle type (whether the Throttle Value in param3 is a percentage, PWM value, etc.)| [`MotorTestThrottleType`] | |"]
2259 #[doc = "| 3 (Throttle)| Throttle value.| | |"]
2260 #[doc = "| 4 (Timeout)| Timeout between tests that are run in sequence.| ≥ 0 | s |"]
2261 #[doc = "| 5 (Motor Count)| Motor count. Number of motors to test in sequence: 0/1=one motor, 2= two motors, etc. The Timeout (param4) is used between tests.| 0, 1, .. | |"]
2262 #[doc = "| 6 (Test Order)| Motor test order.| [`MotorTestOrder`] | |"]
2263 #[doc = "| 7 | Empty | | |"]
2264 MAV_CMD_DO_MOTOR_TEST = 209,
2265 #[doc = "Change to/from inverted flight."]
2266 #[doc = ""]
2267 #[doc = "# Parameters"]
2268 #[doc = ""]
2269 #[doc = "| Parameter | Description | Values |"]
2270 #[doc = "| --------- | ----------- | ------ |"]
2271 #[doc = "| 1 (Inverted)| Inverted flight. (0=normal, 1=inverted)| 0, 1 |"]
2272 #[doc = "| 2 | Empty | |"]
2273 #[doc = "| 3 | Empty | |"]
2274 #[doc = "| 4 | Empty | |"]
2275 #[doc = "| 5 | Empty | |"]
2276 #[doc = "| 6 | Empty | |"]
2277 #[doc = "| 7 | Empty | |"]
2278 MAV_CMD_DO_INVERTED_FLIGHT = 210,
2279 #[doc = "Mission command to operate a gripper."]
2280 #[doc = ""]
2281 #[doc = "# Parameters"]
2282 #[doc = ""]
2283 #[doc = "| Parameter | Description | Values |"]
2284 #[doc = "| --------- | ----------- | ------ |"]
2285 #[doc = "| 1 (Instance)| Gripper instance number.| 1, 2, .. |"]
2286 #[doc = "| 2 (Action)| Gripper action to perform.| [`GripperActions`] |"]
2287 #[doc = "| 3 | Empty | |"]
2288 #[doc = "| 4 | Empty | |"]
2289 #[doc = "| 5 | Empty | |"]
2290 #[doc = "| 6 | Empty | |"]
2291 #[doc = "| 7 | Empty | |"]
2292 MAV_CMD_DO_GRIPPER = 211,
2293 #[doc = "Enable/disable autotune."]
2294 #[doc = ""]
2295 #[doc = "# Parameters"]
2296 #[doc = ""]
2297 #[doc = "| Parameter | Description | Values |"]
2298 #[doc = "| --------- | ----------- | ------ |"]
2299 #[doc = "| 1 (Enable)| Enable (1: enable, 0:disable).| 0, 1 |"]
2300 #[doc = "| 2 (Axis) | Specify axes for which autotuning is enabled/disabled. 0 indicates the field is unused (for compatiblity reasons). If 0 the autopilot will follow its default behaviour, which is usually to tune all axes.| [`AutotuneAxis`] |"]
2301 #[doc = "| 3 | Empty. | |"]
2302 #[doc = "| 4 | Empty. | |"]
2303 #[doc = "| 5 | Empty. | |"]
2304 #[doc = "| 6 | Empty. | |"]
2305 #[doc = "| 7 | Empty. | |"]
2306 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
2307 #[doc = "Sets a desired vehicle turn angle and speed change."]
2308 #[doc = ""]
2309 #[doc = "# Parameters"]
2310 #[doc = ""]
2311 #[doc = "| Parameter | Description | Values | Units |"]
2312 #[doc = "| --------- | ----------- | ------ | ----- |"]
2313 #[doc = "| 1 (Yaw) | Yaw angle to adjust steering by.| | deg |"]
2314 #[doc = "| 2 (Speed) | Speed. | | m/s |"]
2315 #[doc = "| 3 (Angle) | Final angle. (0=absolute, 1=relative)| 0, 1 | |"]
2316 #[doc = "| 4 | Empty | | |"]
2317 #[doc = "| 5 | Empty | | |"]
2318 #[doc = "| 6 | Empty | | |"]
2319 #[doc = "| 7 | Empty | | |"]
2320 MAV_CMD_NAV_SET_YAW_SPEED = 213,
2321 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
2322 #[doc = ""]
2323 #[doc = "# Parameters"]
2324 #[doc = ""]
2325 #[doc = "| Parameter | Description | Values | Units |"]
2326 #[doc = "| --------- | ----------- | ------ | ----- |"]
2327 #[doc = "| 1 (Trigger Cycle)| Camera trigger cycle time. -1 or 0 to ignore.| -1, 0, .. | ms |"]
2328 #[doc = "| 2 (Shutter Integration)| Camera shutter integration time. Should be less than trigger cycle time. -1 or 0 to ignore.| -1, 0, .. | ms |"]
2329 #[doc = "| 3 (Target Camera ID)| Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras attached to the autopilot, which don't have a distinct component id. 0: all cameras. This is used to target specific autopilot-connected cameras. It is also used to target specific cameras when the MAV_CMD is used in a mission.| 0, 1, .. , 255 | |"]
2330 #[doc = "| 4 | Empty | | |"]
2331 #[doc = "| 5 | Empty | | |"]
2332 #[doc = "| 6 | Empty | | |"]
2333 #[doc = "| 7 | Empty | | |"]
2334 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
2335 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
2336 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
2337 #[doc = ""]
2338 #[doc = "# Parameters"]
2339 #[doc = ""]
2340 #[doc = "| Parameter | Description |"]
2341 #[doc = "| --------- | ----------- |"]
2342 #[doc = "| 1 (Q1) | quaternion param q1, w (1 in null-rotation)|"]
2343 #[doc = "| 2 (Q2) | quaternion param q2, x (0 in null-rotation)|"]
2344 #[doc = "| 3 (Q3) | quaternion param q3, y (0 in null-rotation)|"]
2345 #[doc = "| 4 (Q4) | quaternion param q4, z (0 in null-rotation)|"]
2346 #[doc = "| 5 | Empty |"]
2347 #[doc = "| 6 | Empty |"]
2348 #[doc = "| 7 | Empty |"]
2349 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
2350 #[doc = "set id of master controller"]
2351 #[doc = ""]
2352 #[doc = "# Parameters"]
2353 #[doc = ""]
2354 #[doc = "| Parameter | Description | Values |"]
2355 #[doc = "| --------- | ----------- | ------ |"]
2356 #[doc = "| 1 (System ID)| System ID | 0, 1, .. , 255 |"]
2357 #[doc = "| 2 (Component ID)| Component ID| 0, 1, .. , 255 |"]
2358 #[doc = "| 3 | Empty | |"]
2359 #[doc = "| 4 | Empty | |"]
2360 #[doc = "| 5 | Empty | |"]
2361 #[doc = "| 6 | Empty | |"]
2362 #[doc = "| 7 | Empty | |"]
2363 MAV_CMD_DO_GUIDED_MASTER = 221,
2364 #[doc = "Set limits for external control"]
2365 #[doc = ""]
2366 #[doc = "# Parameters"]
2367 #[doc = ""]
2368 #[doc = "| Parameter | Description | Values | Units |"]
2369 #[doc = "| --------- | ----------- | ------ | ----- |"]
2370 #[doc = "| 1 (Timeout)| Timeout - maximum time that external controller will be allowed to control vehicle. 0 means no timeout.| ≥ 0 | s |"]
2371 #[doc = "| 2 (Min Altitude)| Altitude (MSL) min - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit.| | m |"]
2372 #[doc = "| 3 (Max Altitude)| Altitude (MSL) max - if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit.| | m |"]
2373 #[doc = "| 4 (Horiz. Move Limit)| Horizontal move limit - if vehicle moves more than this distance from its location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal move limit.| ≥ 0 | m |"]
2374 #[doc = "| 5 | Empty | | |"]
2375 #[doc = "| 6 | Empty | | |"]
2376 #[doc = "| 7 | Empty | | |"]
2377 MAV_CMD_DO_GUIDED_LIMITS = 222,
2378 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
2379 #[doc = ""]
2380 #[doc = "# Parameters"]
2381 #[doc = ""]
2382 #[doc = "| Parameter | Description | Values | Units |"]
2383 #[doc = "| --------- | ----------- | ------ | ----- |"]
2384 #[doc = "| 1 (Start Engine)| 0: Stop engine, 1:Start Engine| 0, 1 | |"]
2385 #[doc = "| 2 (Cold Start)| 0: Warm start, 1:Cold start. Controls use of choke where applicable| 0, 1 | |"]
2386 #[doc = "| 3 (Height Delay)| Height delay. This is for commanding engine start only after the vehicle has gained the specified height. Used in VTOL vehicles during takeoff to start engine after the aircraft is off the ground. Zero for no delay.| ≥ 0 | m |"]
2387 #[doc = "| 4 | Empty | | |"]
2388 #[doc = "| 5 | Empty | | |"]
2389 #[doc = "| 6 | Empty | | |"]
2390 #[doc = "| 7 | Empty | | |"]
2391 MAV_CMD_DO_ENGINE_CONTROL = 223,
2392 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
2393 #[doc = ""]
2394 #[doc = "# Parameters"]
2395 #[doc = ""]
2396 #[doc = "| Parameter | Description | Values |"]
2397 #[doc = "| --------- | ----------- | ------ |"]
2398 #[doc = "| 1 (Number)| Mission sequence value to set. -1 for the current mission item (use to reset mission without changing current mission item).| -1, 0, .. |"]
2399 #[doc = "| 2 (Reset Mission)| Resets mission. 1: true, 0: false. Resets jump counters to initial values and changes mission state \"completed\" to be \"active\" or \"paused\".| 0, 1 |"]
2400 #[doc = "| 3 | Empty | |"]
2401 #[doc = "| 4 | Empty | |"]
2402 #[doc = "| 5 | Empty | |"]
2403 #[doc = "| 6 | Empty | |"]
2404 #[doc = "| 7 | Empty | |"]
2405 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
2406 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
2407 #[doc = ""]
2408 #[doc = "# Parameters"]
2409 #[doc = ""]
2410 #[doc = "| Parameter | Description |"]
2411 #[doc = "| --------- | ----------- |"]
2412 #[doc = "| 1 | Empty |"]
2413 #[doc = "| 2 | Empty |"]
2414 #[doc = "| 3 | Empty |"]
2415 #[doc = "| 4 | Empty |"]
2416 #[doc = "| 5 | Empty |"]
2417 #[doc = "| 6 | Empty |"]
2418 #[doc = "| 7 | Empty |"]
2419 MAV_CMD_DO_LAST = 240,
2420 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
2421 #[doc = ""]
2422 #[doc = "# Parameters"]
2423 #[doc = ""]
2424 #[doc = "| Parameter | Description | Values |"]
2425 #[doc = "| --------- | ----------- | ------ |"]
2426 #[doc = "| 1 (Gyro Temperature)| 1: gyro calibration, 3: gyro temperature calibration| 0, 1, .. , 3 |"]
2427 #[doc = "| 2 (Magnetometer)| 1: magnetometer calibration| 0, 1 |"]
2428 #[doc = "| 3 (Ground Pressure)| 1: ground pressure calibration| 0, 1 |"]
2429 #[doc = "| 4 (Remote Control)| 1: radio RC calibration, 2: RC trim calibration| 0, 1 |"]
2430 #[doc = "| 5 (Accelerometer)| 1: accelerometer calibration, 2: board level calibration, 3: accelerometer temperature calibration, 4: simple accelerometer calibration| 0, 1, .. , 4 |"]
2431 #[doc = "| 6 (Compmot or Airspeed)| 1: APM: compass/motor interference calibration (PX4: airspeed calibration, deprecated), 2: airspeed calibration| 0, 1, 2 |"]
2432 #[doc = "| 7 (ESC or Baro)| 1: ESC calibration, 3: barometer temperature calibration| 0, 1, .. , 3 |"]
2433 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
2434 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
2435 #[doc = ""]
2436 #[doc = "# Parameters"]
2437 #[doc = ""]
2438 #[doc = "| Parameter | Description | Values |"]
2439 #[doc = "| --------- | ----------- | ------ |"]
2440 #[doc = "| 1 (Sensor Type)| Sensor to adjust the offsets for: 0: gyros, 1: accelerometer, 2: magnetometer, 3: barometer, 4: optical flow, 5: second magnetometer, 6: third magnetometer| 0, 1, .. , 6 |"]
2441 #[doc = "| 2 (X Offset)| X axis offset (or generic dimension 1), in the sensor's raw units| |"]
2442 #[doc = "| 3 (Y Offset)| Y axis offset (or generic dimension 2), in the sensor's raw units| |"]
2443 #[doc = "| 4 (Z Offset)| Z axis offset (or generic dimension 3), in the sensor's raw units| |"]
2444 #[doc = "| 5 (4th Dimension)| Generic dimension 4, in the sensor's raw units| |"]
2445 #[doc = "| 6 (5th Dimension)| Generic dimension 5, in the sensor's raw units| |"]
2446 #[doc = "| 7 (6th Dimension)| Generic dimension 6, in the sensor's raw units| |"]
2447 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
2448 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
2449 #[doc = ""]
2450 #[doc = "# Parameters"]
2451 #[doc = ""]
2452 #[doc = "| Parameter | Description |"]
2453 #[doc = "| --------- | ----------- |"]
2454 #[doc = "| 1 (Actuator ID)| 1: Trigger actuator ID assignment and direction mapping. 0: Cancel command.|"]
2455 #[doc = "| 2 | Reserved |"]
2456 #[doc = "| 3 | Reserved |"]
2457 #[doc = "| 4 | Reserved |"]
2458 #[doc = "| 5 | Reserved |"]
2459 #[doc = "| 6 | Reserved |"]
2460 #[doc = "| 7 | Reserved |"]
2461 MAV_CMD_PREFLIGHT_UAVCAN = 243,
2462 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
2463 #[doc = ""]
2464 #[doc = "# Parameters"]
2465 #[doc = ""]
2466 #[doc = "| Parameter | Description | Values | Units |"]
2467 #[doc = "| --------- | ----------- | ------ | ----- |"]
2468 #[doc = "| 1 (Parameter Storage)| Action to perform on the persistent parameter storage| [`PreflightStorageParameterAction`] | |"]
2469 #[doc = "| 2 (Mission Storage)| Action to perform on the persistent mission storage| [`PreflightStorageMissionAction`] | |"]
2470 #[doc = "| 3 (Logging Rate)| Onboard logging: 0: Ignore, 1: Start default rate logging, -1: Stop logging,>1: logging rate (e.g. set to 1000 for 1000 Hz logging)| -1, 0, .. | Hz |"]
2471 #[doc = "| 4 | Reserved | | |"]
2472 #[doc = "| 5 | Empty | | |"]
2473 #[doc = "| 6 | Empty | | |"]
2474 #[doc = "| 7 | Empty | | |"]
2475 MAV_CMD_PREFLIGHT_STORAGE = 245,
2476 #[doc = "Request the reboot or shutdown of system components."]
2477 #[doc = ""]
2478 #[doc = "# Parameters"]
2479 #[doc = ""]
2480 #[doc = "| Parameter | Description | Values |"]
2481 #[doc = "| --------- | ----------- | ------ |"]
2482 #[doc = "| 1 (Autopilot)| 0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot, 3: Reboot autopilot and keep it in the bootloader until upgraded.| 0, 1, .. , 3 |"]
2483 #[doc = "| 2 (Companion)| 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer, 3: Reboot onboard computer and keep it in the bootloader until upgraded.| 0, 1, .. , 3 |"]
2484 #[doc = "| 3 (Component action)| 0: Do nothing for component, 1: Reboot component, 2: Shutdown component, 3: Reboot component and keep it in the bootloader until upgraded| 0, 1, .. , 3 |"]
2485 #[doc = "| 4 (Component ID)| MAVLink Component ID targeted in param3 (0 for all components).| 0, 1, .. , 255 |"]
2486 #[doc = "| 5 | Reserved (set to 0)| |"]
2487 #[doc = "| 6 (Conditions)| Conditions under which reboot/shutdown is allowed.| [`RebootShutdownConditions`] |"]
2488 #[doc = "| 7 | WIP: ID (e.g. camera ID -1 for all IDs)| |"]
2489 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
2490 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
2491 #[doc = ""]
2492 #[doc = "# Parameters"]
2493 #[doc = ""]
2494 #[doc = "| Parameter | Description | Values | Units |"]
2495 #[doc = "| --------- | ----------- | ------ | ----- |"]
2496 #[doc = "| 1 (Continue)| MAV_GOTO_DO_HOLD: pause mission and either hold or move to specified position (depending on param2), MAV_GOTO_DO_CONTINUE: resume mission.| [`MavGoto`] | |"]
2497 #[doc = "| 2 (Position)| MAV_GOTO_HOLD_AT_CURRENT_POSITION: hold at current position, MAV_GOTO_HOLD_AT_SPECIFIED_POSITION: hold at specified position.| [`MavGoto`] | |"]
2498 #[doc = "| 3 (Frame) | Coordinate frame of hold point.| [`MavFrame`] | |"]
2499 #[doc = "| 4 (Yaw) | Desired yaw angle.| | deg |"]
2500 #[doc = "| 5 (Latitude/X)| Latitude/X position.| | |"]
2501 #[doc = "| 6 (Longitude/Y)| Longitude/Y position.| | |"]
2502 #[doc = "| 7 (Altitude/Z)| Altitude/Z position.| | |"]
2503 MAV_CMD_OVERRIDE_GOTO = 252,
2504 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
2505 #[doc = ""]
2506 #[doc = "# Parameters"]
2507 #[doc = ""]
2508 #[doc = "| Parameter | Description | Values | Units |"]
2509 #[doc = "| --------- | ----------- | ------ | ----- |"]
2510 #[doc = "| 1 (Distance)| Camera trigger distance. 0 to stop triggering.| ≥ 0 | m |"]
2511 #[doc = "| 2 (Shutter)| Camera shutter integration time. 0 to ignore| 0, 1, .. | ms |"]
2512 #[doc = "| 3 (Min Interval)| The minimum interval in which the camera is capable of taking subsequent pictures repeatedly. 0 to ignore.| 0, 1, .. , 10000 | ms |"]
2513 #[doc = "| 4 (Positions)| Total number of roll positions at which the camera will capture photos (images captures spread evenly across the limits defined by param5).| 2, 3, .. | |"]
2514 #[doc = "| 5 (Roll Angle)| Angle limits that the camera can be rolled to left and right of center.| ≥ 0 | deg |"]
2515 #[doc = "| 6 (Pitch Angle)| Fixed pitch angle that the camera will hold in oblique mode if the mount is actuated in the pitch axis.| -180 .. 180 | deg |"]
2516 #[doc = "| 7 | Empty | | |"]
2517 MAV_CMD_OBLIQUE_SURVEY = 260,
2518 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
2519 #[doc = ""]
2520 #[doc = "# Parameters"]
2521 #[doc = ""]
2522 #[doc = "| Parameter | Description | Values |"]
2523 #[doc = "| --------- | ----------- | ------ |"]
2524 #[doc = "| 1 (Standard Mode)| The mode to set.| [`MavStandardMode`] |"]
2525 #[doc = "| 2 | | Reserved (use 0) |"]
2526 #[doc = "| 3 | | Reserved (use 0) |"]
2527 #[doc = "| 4 | | Reserved (use 0) |"]
2528 #[doc = "| 5 | | Reserved (use 0) |"]
2529 #[doc = "| 6 | | Reserved (use 0) |"]
2530 #[doc = "| 7 | | Reserved (use NaN) |"]
2531 MAV_CMD_DO_SET_STANDARD_MODE = 262,
2532 #[doc = "start running a mission"]
2533 #[doc = ""]
2534 #[doc = "# Parameters"]
2535 #[doc = ""]
2536 #[doc = "| Parameter | Description | Values |"]
2537 #[doc = "| --------- | ----------- | ------ |"]
2538 #[doc = "| 1 (First Item)| first_item: the first mission item to run| 0, 1, .. |"]
2539 #[doc = "| 2 (Last Item)| last_item: the last mission item to run (after this item is run, the mission ends)| 0, 1, .. |"]
2540 MAV_CMD_MISSION_START = 300,
2541 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
2542 #[doc = ""]
2543 #[doc = "# Parameters"]
2544 #[doc = ""]
2545 #[doc = "| Parameter | Description | Values | Units |"]
2546 #[doc = "| --------- | ----------- | ------ | ----- |"]
2547 #[doc = "| 1 (Value) | Output value: 1 means maximum positive output, 0 to center servos or minimum motor thrust (expected to spin), -1 for maximum negative (if not supported by the motors, i.e. motor is not reversible, smaller than 0 maps to NaN). And NaN maps to disarmed (stop the motors).| -1 .. 1 | |"]
2548 #[doc = "| 2 (Timeout)| Timeout after which the test command expires and the output is restored to the previous value. A timeout has to be set for safety reasons. A timeout of 0 means to restore the previous value immediately.| 0 .. 3 | s |"]
2549 #[doc = "| 3 | | Reserved (use 0) | |"]
2550 #[doc = "| 4 | | Reserved (use 0) | |"]
2551 #[doc = "| 5 (Output Function)| Actuator Output function| [`ActuatorOutputFunction`] | |"]
2552 #[doc = "| 6 | | Reserved (use 0) | |"]
2553 #[doc = "| 7 | | Reserved (use 0) | |"]
2554 MAV_CMD_ACTUATOR_TEST = 310,
2555 #[doc = "Actuator configuration command."]
2556 #[doc = ""]
2557 #[doc = "# Parameters"]
2558 #[doc = ""]
2559 #[doc = "| Parameter | Description | Values |"]
2560 #[doc = "| --------- | ----------- | ------ |"]
2561 #[doc = "| 1 (Configuration)| Actuator configuration action| [`ActuatorConfiguration`] |"]
2562 #[doc = "| 2 | | Reserved (use 0) |"]
2563 #[doc = "| 3 | | Reserved (use 0) |"]
2564 #[doc = "| 4 | | Reserved (use 0) |"]
2565 #[doc = "| 5 (Output Function)| Actuator Output function| [`ActuatorOutputFunction`] |"]
2566 #[doc = "| 6 | | Reserved (use 0) |"]
2567 #[doc = "| 7 | | Reserved (use 0) |"]
2568 MAV_CMD_CONFIGURE_ACTUATOR = 311,
2569 #[doc = "Arms / Disarms a component"]
2570 #[doc = ""]
2571 #[doc = "# Parameters"]
2572 #[doc = ""]
2573 #[doc = "| Parameter | Description | Values |"]
2574 #[doc = "| --------- | ----------- | ------ |"]
2575 #[doc = "| 1 (Arm) | 0: disarm, 1: arm| 0, 1 |"]
2576 #[doc = "| 2 (Force) | 0: arm-disarm unless prevented by safety checks (i.e. when landed), 21196: force arming/disarming (e.g. allow arming to override preflight checks and disarming in flight)| 0, 21196 |"]
2577 MAV_CMD_COMPONENT_ARM_DISARM = 400,
2578 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
2579 MAV_CMD_RUN_PREARM_CHECKS = 401,
2580 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
2581 #[doc = ""]
2582 #[doc = "# Parameters"]
2583 #[doc = ""]
2584 #[doc = "| Parameter | Description | Values |"]
2585 #[doc = "| --------- | ----------- | ------ |"]
2586 #[doc = "| 1 (Enable)| 0: Illuminators OFF, 1: Illuminators ON| 0, 1 |"]
2587 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
2588 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
2589 #[doc = ""]
2590 #[doc = "# Parameters"]
2591 #[doc = ""]
2592 #[doc = "| Parameter | Description | Values | Units |"]
2593 #[doc = "| --------- | ----------- | ------ | ----- |"]
2594 #[doc = "| 1 (Mode) | Mode | [`IlluminatorMode`] | |"]
2595 #[doc = "| 2 (Brightness)| 0%: Off, 100%: Max Brightness| 0 .. 100 | % |"]
2596 #[doc = "| 3 (Strobe Period)| Strobe period in seconds where 0 means strobing is not used| ≥ 0 | s |"]
2597 #[doc = "| 4 (Strobe Duty)| Strobe duty cycle where 100% means it is on constantly and 0 means strobing is not used| 0 .. 100 | % |"]
2598 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
2599 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
2600 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
2601 #[doc = ""]
2602 #[doc = "# Parameters"]
2603 #[doc = ""]
2604 #[doc = "| Parameter | Description |"]
2605 #[doc = "| --------- | ----------- |"]
2606 #[doc = "| 1 | Reserved |"]
2607 #[doc = "| 2 | Reserved |"]
2608 #[doc = "| 3 | Reserved |"]
2609 #[doc = "| 4 | Reserved |"]
2610 #[doc = "| 5 | Reserved |"]
2611 #[doc = "| 6 | Reserved |"]
2612 #[doc = "| 7 | Reserved |"]
2613 MAV_CMD_GET_HOME_POSITION = 410,
2614 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
2615 #[doc = ""]
2616 #[doc = "# Parameters"]
2617 #[doc = ""]
2618 #[doc = "| Parameter | Description | Values |"]
2619 #[doc = "| --------- | ----------- | ------ |"]
2620 #[doc = "| 1 (Failure unit)| The unit which is affected by the failure.| [`FailureUnit`] |"]
2621 #[doc = "| 2 (Failure type)| The type how the failure manifests itself.| [`FailureType`] |"]
2622 #[doc = "| 3 (Instance)| Instance affected by failure (0 to signal all).| |"]
2623 MAV_CMD_INJECT_FAILURE = 420,
2624 #[doc = "Starts receiver pairing."]
2625 #[doc = ""]
2626 #[doc = "# Parameters"]
2627 #[doc = ""]
2628 #[doc = "| Parameter | Description | Values |"]
2629 #[doc = "| --------- | ----------- | ------ |"]
2630 #[doc = "| 1 (RC Type)| RC type. | [`RcType`] |"]
2631 #[doc = "| 2 (RC Sub Type)| RC sub type.| [`RcSubType`] |"]
2632 MAV_CMD_START_RX_PAIR = 500,
2633 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
2634 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
2635 #[doc = ""]
2636 #[doc = "# Parameters"]
2637 #[doc = ""]
2638 #[doc = "| Parameter | Description | Values |"]
2639 #[doc = "| --------- | ----------- | ------ |"]
2640 #[doc = "| 1 (Message ID)| The MAVLink message ID| 0, 1, .. , 16777215 |"]
2641 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
2642 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
2643 #[doc = ""]
2644 #[doc = "# Parameters"]
2645 #[doc = ""]
2646 #[doc = "| Parameter | Description | Values | Units |"]
2647 #[doc = "| --------- | ----------- | ------ | ----- |"]
2648 #[doc = "| 1 (Message ID)| The MAVLink message ID| 0, 1, .. , 16777215 | |"]
2649 #[doc = "| 2 (Interval)| The interval between two messages. -1: disable. 0: request default rate (which may be zero).| -1, 0, .. | us |"]
2650 #[doc = "| 3 (Req Param 3)| Use for index ID, if required. Otherwise, the use of this parameter (if any) must be defined in the requested message. By default assumed not used (0). When used as an index ID, 0 means \"all instances\", \"1\" means the first instance in the sequence (the emitted message will have an id of 0 if message ids are 0-indexed, or 1 if index numbers start from one).| | |"]
2651 #[doc = "| 4 (Req Param 4)| The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0).| | |"]
2652 #[doc = "| 5 (Req Param 5)| The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0/NaN).| | |"]
2653 #[doc = "| 6 (Req Param 6)| The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0/NaN).| | |"]
2654 #[doc = "| 7 (Response Target)| Target address of message stream (if message has target address fields). 0: Flight-stack default (recommended), 1: address of requestor, 2: broadcast.| 0, 1, 2 | |"]
2655 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
2656 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
2657 #[doc = ""]
2658 #[doc = "# Parameters"]
2659 #[doc = ""]
2660 #[doc = "| Parameter | Description | Values |"]
2661 #[doc = "| --------- | ----------- | ------ |"]
2662 #[doc = "| 1 (Message ID)| The MAVLink message ID of the requested message.| 0, 1, .. , 16777215 |"]
2663 #[doc = "| 2 (Req Param 1)| Use for index ID, if required. Otherwise, the use of this parameter (if any) must be defined in the requested message. By default assumed not used (0).| |"]
2664 #[doc = "| 3 (Req Param 2)| The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0).| |"]
2665 #[doc = "| 4 (Req Param 3)| The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0).| |"]
2666 #[doc = "| 5 (Req Param 4)| The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0).| |"]
2667 #[doc = "| 6 (Req Param 5)| The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0).| |"]
2668 #[doc = "| 7 (Response Target)| Target address for requested message (if message has target address fields). 0: Flight-stack default, 1: address of requestor, 2: broadcast.| 0, 1, 2 |"]
2669 MAV_CMD_REQUEST_MESSAGE = 512,
2670 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2671 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
2672 #[doc = ""]
2673 #[doc = "# Parameters"]
2674 #[doc = ""]
2675 #[doc = "| Parameter | Description | Values |"]
2676 #[doc = "| --------- | ----------- | ------ |"]
2677 #[doc = "| 1 (Protocol)| 1: Request supported protocol versions by all nodes on the network| 0, 1 |"]
2678 #[doc = "| 2 | Reserved (all remaining params)| |"]
2679 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
2680 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2681 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
2682 #[doc = ""]
2683 #[doc = "# Parameters"]
2684 #[doc = ""]
2685 #[doc = "| Parameter | Description | Values |"]
2686 #[doc = "| --------- | ----------- | ------ |"]
2687 #[doc = "| 1 (Version)| 1: Request autopilot version| 0, 1 |"]
2688 #[doc = "| 2 | Reserved (all remaining params)| |"]
2689 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
2690 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2691 #[doc = "Request camera information (CAMERA_INFORMATION)."]
2692 #[doc = ""]
2693 #[doc = "# Parameters"]
2694 #[doc = ""]
2695 #[doc = "| Parameter | Description | Values |"]
2696 #[doc = "| --------- | ----------- | ------ |"]
2697 #[doc = "| 1 (Capabilities)| 0: No action 1: Request camera capabilities| 0, 1 |"]
2698 #[doc = "| 2 | Reserved (all remaining params)| |"]
2699 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
2700 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2701 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
2702 #[doc = ""]
2703 #[doc = "# Parameters"]
2704 #[doc = ""]
2705 #[doc = "| Parameter | Description | Values |"]
2706 #[doc = "| --------- | ----------- | ------ |"]
2707 #[doc = "| 1 (Settings)| 0: No Action 1: Request camera settings| 0, 1 |"]
2708 #[doc = "| 2 | Reserved (all remaining params)| |"]
2709 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
2710 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2711 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
2712 #[doc = ""]
2713 #[doc = "# Parameters"]
2714 #[doc = ""]
2715 #[doc = "| Parameter | Description | Values |"]
2716 #[doc = "| --------- | ----------- | ------ |"]
2717 #[doc = "| 1 (Storage ID)| Storage ID (0 for all, 1 for first, 2 for second, etc.)| 0, 1, .. |"]
2718 #[doc = "| 2 (Information)| 0: No Action 1: Request storage information| 0, 1 |"]
2719 #[doc = "| 3 | Reserved (all remaining params)| |"]
2720 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
2721 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
2722 #[doc = ""]
2723 #[doc = "# Parameters"]
2724 #[doc = ""]
2725 #[doc = "| Parameter | Description | Values |"]
2726 #[doc = "| --------- | ----------- | ------ |"]
2727 #[doc = "| 1 (Storage ID)| Storage ID (1 for first, 2 for second, etc.)| 0, 1, .. |"]
2728 #[doc = "| 2 (Format)| Format storage (and reset image log). 0: No action 1: Format storage| 0, 1 |"]
2729 #[doc = "| 3 (Reset Image Log)| Reset Image Log (without formatting storage medium). This will reset CAMERA_CAPTURE_STATUS.image_count and CAMERA_IMAGE_CAPTURED.image_index. 0: No action 1: Reset Image Log| 0, 1 |"]
2730 #[doc = "| 4 | Reserved (all remaining params)| |"]
2731 MAV_CMD_STORAGE_FORMAT = 526,
2732 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2733 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
2734 #[doc = ""]
2735 #[doc = "# Parameters"]
2736 #[doc = ""]
2737 #[doc = "| Parameter | Description | Values |"]
2738 #[doc = "| --------- | ----------- | ------ |"]
2739 #[doc = "| 1 (Capture Status)| 0: No Action 1: Request camera capture status| 0, 1 |"]
2740 #[doc = "| 2 | Reserved (all remaining params)| |"]
2741 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
2742 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2743 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
2744 #[doc = ""]
2745 #[doc = "# Parameters"]
2746 #[doc = ""]
2747 #[doc = "| Parameter | Description | Values |"]
2748 #[doc = "| --------- | ----------- | ------ |"]
2749 #[doc = "| 1 (Flight Information)| 1: Request flight information| 0, 1 |"]
2750 #[doc = "| 2 | Reserved (all remaining params)| |"]
2751 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
2752 #[doc = "Reset all camera settings to Factory Default"]
2753 #[doc = ""]
2754 #[doc = "# Parameters"]
2755 #[doc = ""]
2756 #[doc = "| Parameter | Description | Values |"]
2757 #[doc = "| --------- | ----------- | ------ |"]
2758 #[doc = "| 1 (Reset) | 0: No Action 1: Reset all settings| 0, 1 |"]
2759 #[doc = "| 2 (Target Camera ID)| Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras attached to the autopilot, which don't have a distinct component id. 0: all cameras. This is used to target specific autopilot-connected cameras. It is also used to target specific cameras when the MAV_CMD is used in a mission.| 0, 1, .. , 255 |"]
2760 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
2761 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
2762 #[doc = ""]
2763 #[doc = "# Parameters"]
2764 #[doc = ""]
2765 #[doc = "| Parameter | Description | Values |"]
2766 #[doc = "| --------- | ----------- | ------ |"]
2767 #[doc = "| 1 (id) | Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras attached to the autopilot, which don't have a distinct component id. 0: all cameras. This is used to target specific autopilot-connected cameras. It is also used to target specific cameras when the MAV_CMD is used in a mission.| 0, 1, .. , 255 |"]
2768 #[doc = "| 2 (Camera Mode)| Camera mode | [`CameraMode`] |"]
2769 #[doc = "| 3 | | Reserved (use NaN) |"]
2770 #[doc = "| 4 | | Reserved (use NaN) |"]
2771 #[doc = "| 5 | | |"]
2772 #[doc = "| 6 | | |"]
2773 #[doc = "| 7 | | Reserved (use NaN) |"]
2774 MAV_CMD_SET_CAMERA_MODE = 530,
2775 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
2776 #[doc = ""]
2777 #[doc = "# Parameters"]
2778 #[doc = ""]
2779 #[doc = "| Parameter | Description | Values |"]
2780 #[doc = "| --------- | ----------- | ------ |"]
2781 #[doc = "| 1 (Zoom Type)| Zoom type | [`CameraZoomType`] |"]
2782 #[doc = "| 2 (Zoom Value)| Zoom value. The range of valid values depend on the zoom type.| |"]
2783 #[doc = "| 3 (Target Camera ID)| Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras attached to the autopilot, which don't have a distinct component id. 0: all cameras. This is used to target specific autopilot-connected cameras. It is also used to target specific cameras when the MAV_CMD is used in a mission.| 0, 1, .. , 255 |"]
2784 #[doc = "| 4 | | Reserved (use NaN) |"]
2785 MAV_CMD_SET_CAMERA_ZOOM = 531,
2786 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
2787 #[doc = ""]
2788 #[doc = "# Parameters"]
2789 #[doc = ""]
2790 #[doc = "| Parameter | Description | Values |"]
2791 #[doc = "| --------- | ----------- | ------ |"]
2792 #[doc = "| 1 (Focus Type)| Focus type | [`SetFocusType`] |"]
2793 #[doc = "| 2 (Focus Value)| Focus value | |"]
2794 #[doc = "| 3 (Target Camera ID)| Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras attached to the autopilot, which don't have a distinct component id. 0: all cameras. This is used to target specific autopilot-connected cameras. It is also used to target specific cameras when the MAV_CMD is used in a mission.| 0, 1, .. , 255 |"]
2795 #[doc = "| 4 | | Reserved (use NaN) |"]
2796 MAV_CMD_SET_CAMERA_FOCUS = 532,
2797 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
2798 #[doc = ""]
2799 #[doc = "# Parameters"]
2800 #[doc = ""]
2801 #[doc = "| Parameter | Description | Values |"]
2802 #[doc = "| --------- | ----------- | ------ |"]
2803 #[doc = "| 1 (Storage ID)| Storage ID (1 for first, 2 for second, etc.)| 0, 1, .. |"]
2804 #[doc = "| 2 (Usage) | Usage flags | [`StorageUsageFlag`] |"]
2805 MAV_CMD_SET_STORAGE_USAGE = 533,
2806 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
2807 #[doc = ""]
2808 #[doc = "# Parameters"]
2809 #[doc = ""]
2810 #[doc = "| Parameter | Description | Values |"]
2811 #[doc = "| --------- | ----------- | ------ |"]
2812 #[doc = "| 1 (device id)| Component Id of camera to address or 1-6 for non-MAVLink cameras, 0 for all cameras.| |"]
2813 #[doc = "| 2 (primary source)| Primary Source| [`CameraSource`] |"]
2814 #[doc = "| 3 (secondary source)| Secondary Source. If non-zero the second source will be displayed as picture-in-picture.| [`CameraSource`] |"]
2815 MAV_CMD_SET_CAMERA_SOURCE = 534,
2816 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
2817 #[doc = ""]
2818 #[doc = "# Parameters"]
2819 #[doc = ""]
2820 #[doc = "| Parameter | Description | Values |"]
2821 #[doc = "| --------- | ----------- | ------ |"]
2822 #[doc = "| 1 (Tag) | Tag. | 0, 1, .. |"]
2823 MAV_CMD_JUMP_TAG = 600,
2824 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
2825 #[doc = ""]
2826 #[doc = "# Parameters"]
2827 #[doc = ""]
2828 #[doc = "| Parameter | Description | Values |"]
2829 #[doc = "| --------- | ----------- | ------ |"]
2830 #[doc = "| 1 (Tag) | Target tag to jump to.| 0, 1, .. |"]
2831 #[doc = "| 2 (Repeat)| Repeat count.| 0, 1, .. |"]
2832 MAV_CMD_DO_JUMP_TAG = 601,
2833 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
2834 #[doc = ""]
2835 #[doc = "# Parameters"]
2836 #[doc = ""]
2837 #[doc = "| Parameter | Description | Values | Units |"]
2838 #[doc = "| --------- | ----------- | ------ | ----- |"]
2839 #[doc = "| 1 (Pitch angle)| Pitch angle (positive to pitch up, relative to vehicle for FOLLOW mode, relative to world horizon for LOCK mode).| -180 .. 180 | deg |"]
2840 #[doc = "| 2 (Yaw angle)| Yaw angle (positive to yaw to the right, relative to vehicle for FOLLOW mode, absolute to North for LOCK mode).| -180 .. 180 | deg |"]
2841 #[doc = "| 3 (Pitch rate)| Pitch rate (positive to pitch up).| | deg/s |"]
2842 #[doc = "| 4 (Yaw rate)| Yaw rate (positive to yaw to the right).| | deg/s |"]
2843 #[doc = "| 5 (Gimbal manager flags)| Gimbal manager flags to use.| [`GimbalManagerFlags`] | |"]
2844 #[doc = "| 6 | | | |"]
2845 #[doc = "| 7 (Gimbal device ID)| Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals).| | |"]
2846 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
2847 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
2848 #[doc = ""]
2849 #[doc = "# Parameters"]
2850 #[doc = ""]
2851 #[doc = "| Parameter | Description |"]
2852 #[doc = "| --------- | ----------- |"]
2853 #[doc = "| 1 (sysid primary control)| Sysid for primary control (0: no one in control, -1: leave unchanged, -2: set itself in control (for missions where the own sysid is still unknown), -3: remove control if currently in control).|"]
2854 #[doc = "| 2 (compid primary control)| Compid for primary control (0: no one in control, -1: leave unchanged, -2: set itself in control (for missions where the own sysid is still unknown), -3: remove control if currently in control).|"]
2855 #[doc = "| 3 (sysid secondary control)| Sysid for secondary control (0: no one in control, -1: leave unchanged, -2: set itself in control (for missions where the own sysid is still unknown), -3: remove control if currently in control).|"]
2856 #[doc = "| 4 (compid secondary control)| Compid for secondary control (0: no one in control, -1: leave unchanged, -2: set itself in control (for missions where the own sysid is still unknown), -3: remove control if currently in control).|"]
2857 #[doc = "| 5 | |"]
2858 #[doc = "| 6 | |"]
2859 #[doc = "| 7 (Gimbal device ID)| Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals).|"]
2860 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
2861 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
2862 #[doc = ""]
2863 #[doc = "# Parameters"]
2864 #[doc = ""]
2865 #[doc = "| Parameter | Description | Values | Units |"]
2866 #[doc = "| --------- | ----------- | ------ | ----- |"]
2867 #[doc = "| 1 (Target Camera ID)| Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras attached to the autopilot, which don't have a distinct component id. 0: all cameras. This is used to target specific autopilot-connected cameras. It is also used to target specific cameras when the MAV_CMD is used in a mission.| 0, 1, .. , 255 | |"]
2868 #[doc = "| 2 (Interval)| Desired elapsed time between two consecutive pictures (in seconds). Minimum values depend on hardware (typically greater than 2 seconds).| ≥ 0 | s |"]
2869 #[doc = "| 3 (Total Images)| Total number of images to capture. 0 to capture forever/until MAV_CMD_IMAGE_STOP_CAPTURE.| 0, 1, .. | |"]
2870 #[doc = "| 4 (Sequence Number)| Capture sequence number starting from 1. This is only valid for single-capture (param3 == 1), otherwise set to 0. Increment the capture ID for each capture command to prevent double captures when a command is re-transmitted.| 1, 2, .. | |"]
2871 #[doc = "| 5 | | | |"]
2872 #[doc = "| 6 | | | |"]
2873 #[doc = "| 7 | | Reserved (use NaN) | |"]
2874 MAV_CMD_IMAGE_START_CAPTURE = 2000,
2875 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
2876 #[doc = ""]
2877 #[doc = "# Parameters"]
2878 #[doc = ""]
2879 #[doc = "| Parameter | Description | Values |"]
2880 #[doc = "| --------- | ----------- | ------ |"]
2881 #[doc = "| 1 (Target Camera ID)| Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras attached to the autopilot, which don't have a distinct component id. 0: all cameras. This is used to target specific autopilot-connected cameras. It is also used to target specific cameras when the MAV_CMD is used in a mission.| 0, 1, .. , 255 |"]
2882 #[doc = "| 2 | | Reserved (use NaN) |"]
2883 #[doc = "| 3 | | Reserved (use NaN) |"]
2884 #[doc = "| 4 | | Reserved (use NaN) |"]
2885 #[doc = "| 5 | | |"]
2886 #[doc = "| 6 | | |"]
2887 #[doc = "| 7 | | Reserved (use NaN) |"]
2888 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
2889 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2890 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
2891 #[doc = ""]
2892 #[doc = "# Parameters"]
2893 #[doc = ""]
2894 #[doc = "| Parameter | Description | Values |"]
2895 #[doc = "| --------- | ----------- | ------ |"]
2896 #[doc = "| 1 (Number)| Sequence number for missing CAMERA_IMAGE_CAPTURED message| 0, 1, .. |"]
2897 #[doc = "| 2 | | Reserved (use NaN) |"]
2898 #[doc = "| 3 | | Reserved (use NaN) |"]
2899 #[doc = "| 4 | | Reserved (use NaN) |"]
2900 #[doc = "| 5 | | |"]
2901 #[doc = "| 6 | | |"]
2902 #[doc = "| 7 | | Reserved (use NaN) |"]
2903 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
2904 #[doc = "Enable or disable on-board camera triggering system."]
2905 #[doc = ""]
2906 #[doc = "# Parameters"]
2907 #[doc = ""]
2908 #[doc = "| Parameter | Description | Values |"]
2909 #[doc = "| --------- | ----------- | ------ |"]
2910 #[doc = "| 1 (Enable)| Trigger enable/disable (0 for disable, 1 for start), -1 to ignore| -1, 0, 1 |"]
2911 #[doc = "| 2 (Reset) | 1 to reset the trigger sequence, -1 or 0 to ignore| -1, 0, 1 |"]
2912 #[doc = "| 3 (Pause) | 1 to pause triggering, but without switching the camera off or retracting it. -1 to ignore| -1, 1 |"]
2913 #[doc = "| 4 (Target Camera ID)| Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras attached to the autopilot, which don't have a distinct component id. 0: all cameras. This is used to target specific autopilot-connected cameras. It is also used to target specific cameras when the MAV_CMD is used in a mission.| 0, 1, .. , 255 |"]
2914 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
2915 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
2916 #[doc = ""]
2917 #[doc = "# Parameters"]
2918 #[doc = ""]
2919 #[doc = "| Parameter | Description | Values |"]
2920 #[doc = "| --------- | ----------- | ------ |"]
2921 #[doc = "| 1 (Point x)| Point to track x value (normalized 0..1, 0 is left, 1 is right).| 0 .. 1 |"]
2922 #[doc = "| 2 (Point y)| Point to track y value (normalized 0..1, 0 is top, 1 is bottom).| 0 .. 1 |"]
2923 #[doc = "| 3 (Radius)| Point radius (normalized 0..1, 0 is one pixel, 1 is full image width).| 0 .. 1 |"]
2924 #[doc = "| 4 (Target Camera ID)| Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras attached to the autopilot, which don't have a distinct component id. 0: all cameras. This is used to target specific autopilot-connected cameras. It is also used to target specific cameras when the MAV_CMD is used in a mission.| 0, 1, .. , 255 |"]
2925 MAV_CMD_CAMERA_TRACK_POINT = 2004,
2926 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
2927 #[doc = ""]
2928 #[doc = "# Parameters"]
2929 #[doc = ""]
2930 #[doc = "| Parameter | Description | Values |"]
2931 #[doc = "| --------- | ----------- | ------ |"]
2932 #[doc = "| 1 (Top left corner x)| Top left corner of rectangle x value (normalized 0..1, 0 is left, 1 is right).| 0 .. 1 |"]
2933 #[doc = "| 2 (Top left corner y)| Top left corner of rectangle y value (normalized 0..1, 0 is top, 1 is bottom).| 0 .. 1 |"]
2934 #[doc = "| 3 (Bottom right corner x)| Bottom right corner of rectangle x value (normalized 0..1, 0 is left, 1 is right).| 0 .. 1 |"]
2935 #[doc = "| 4 (Bottom right corner y)| Bottom right corner of rectangle y value (normalized 0..1, 0 is top, 1 is bottom).| 0 .. 1 |"]
2936 #[doc = "| 5 (Target Camera ID)| Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras attached to the autopilot, which don't have a distinct component id. 0: all cameras. This is used to target specific autopilot-connected cameras. It is also used to target specific cameras when the MAV_CMD is used in a mission.| 0, 1, .. , 255 |"]
2937 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
2938 #[doc = "Stops ongoing tracking."]
2939 #[doc = ""]
2940 #[doc = "# Parameters"]
2941 #[doc = ""]
2942 #[doc = "| Parameter | Description | Values |"]
2943 #[doc = "| --------- | ----------- | ------ |"]
2944 #[doc = "| 1 (Target Camera ID)| Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras attached to the autopilot, which don't have a distinct component id. 0: all cameras. This is used to target specific autopilot-connected cameras. It is also used to target specific cameras when the MAV_CMD is used in a mission.| 0, 1, .. , 255 |"]
2945 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
2946 #[doc = "Starts video capture (recording)."]
2947 #[doc = ""]
2948 #[doc = "# Parameters"]
2949 #[doc = ""]
2950 #[doc = "| Parameter | Description | Values | Units |"]
2951 #[doc = "| --------- | ----------- | ------ | ----- |"]
2952 #[doc = "| 1 (Stream ID)| Video Stream ID (0 for all streams)| 0, 1, .. | |"]
2953 #[doc = "| 2 (Status Frequency)| Frequency CAMERA_CAPTURE_STATUS messages should be sent while recording (0 for no messages, otherwise frequency)| ≥ 0 | Hz |"]
2954 #[doc = "| 3 (Target Camera ID)| Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras attached to the autopilot, which don't have a distinct component id. 0: all cameras. This is used to target specific autopilot-connected cameras. It is also used to target specific cameras when the MAV_CMD is used in a mission.| 0, 1, .. , 255 | |"]
2955 #[doc = "| 4 | | Reserved (use NaN) | |"]
2956 #[doc = "| 5 | | | |"]
2957 #[doc = "| 6 | | | |"]
2958 #[doc = "| 7 | | Reserved (use NaN) | |"]
2959 MAV_CMD_VIDEO_START_CAPTURE = 2500,
2960 #[doc = "Stop the current video capture (recording)."]
2961 #[doc = ""]
2962 #[doc = "# Parameters"]
2963 #[doc = ""]
2964 #[doc = "| Parameter | Description | Values |"]
2965 #[doc = "| --------- | ----------- | ------ |"]
2966 #[doc = "| 1 (Stream ID)| Video Stream ID (0 for all streams)| 0, 1, .. |"]
2967 #[doc = "| 2 (Target Camera ID)| Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras attached to the autopilot, which don't have a distinct component id. 0: all cameras. This is used to target specific autopilot-connected cameras. It is also used to target specific cameras when the MAV_CMD is used in a mission.| 0, 1, .. , 255 |"]
2968 #[doc = "| 3 | | Reserved (use NaN) |"]
2969 #[doc = "| 4 | | Reserved (use NaN) |"]
2970 #[doc = "| 5 | | |"]
2971 #[doc = "| 6 | | |"]
2972 #[doc = "| 7 | | Reserved (use NaN) |"]
2973 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
2974 #[doc = "Start video streaming"]
2975 #[doc = ""]
2976 #[doc = "# Parameters"]
2977 #[doc = ""]
2978 #[doc = "| Parameter | Description | Values |"]
2979 #[doc = "| --------- | ----------- | ------ |"]
2980 #[doc = "| 1 (Stream ID)| Video Stream ID (0 for all streams, 1 for first, 2 for second, etc.)| 0, 1, .. |"]
2981 #[doc = "| 2 (Target Camera ID)| Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras attached to the autopilot, which don't have a distinct component id. 0: all cameras. This is used to target specific autopilot-connected cameras. It is also used to target specific cameras when the MAV_CMD is used in a mission.| 0, 1, .. , 255 |"]
2982 MAV_CMD_VIDEO_START_STREAMING = 2502,
2983 #[doc = "Stop the given video stream"]
2984 #[doc = ""]
2985 #[doc = "# Parameters"]
2986 #[doc = ""]
2987 #[doc = "| Parameter | Description | Values |"]
2988 #[doc = "| --------- | ----------- | ------ |"]
2989 #[doc = "| 1 (Stream ID)| Video Stream ID (0 for all streams, 1 for first, 2 for second, etc.)| 0, 1, .. |"]
2990 #[doc = "| 2 (Target Camera ID)| Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras attached to the autopilot, which don't have a distinct component id. 0: all cameras. This is used to target specific autopilot-connected cameras. It is also used to target specific cameras when the MAV_CMD is used in a mission.| 0, 1, .. , 255 |"]
2991 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
2992 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2993 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
2994 #[doc = ""]
2995 #[doc = "# Parameters"]
2996 #[doc = ""]
2997 #[doc = "| Parameter | Description | Values |"]
2998 #[doc = "| --------- | ----------- | ------ |"]
2999 #[doc = "| 1 (Stream ID)| Video Stream ID (0 for all streams, 1 for first, 2 for second, etc.)| 0, 1, .. |"]
3000 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
3001 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
3002 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
3003 #[doc = ""]
3004 #[doc = "# Parameters"]
3005 #[doc = ""]
3006 #[doc = "| Parameter | Description | Values |"]
3007 #[doc = "| --------- | ----------- | ------ |"]
3008 #[doc = "| 1 (Stream ID)| Video Stream ID (0 for all streams, 1 for first, 2 for second, etc.)| 0, 1, .. |"]
3009 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
3010 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
3011 #[doc = ""]
3012 #[doc = "# Parameters"]
3013 #[doc = ""]
3014 #[doc = "| Parameter | Description | Values |"]
3015 #[doc = "| --------- | ----------- | ------ |"]
3016 #[doc = "| 1 (Format)| Format: 0: ULog| 0, 1, .. |"]
3017 #[doc = "| 2 | Reserved (set to 0)| |"]
3018 #[doc = "| 3 | Reserved (set to 0)| |"]
3019 #[doc = "| 4 | Reserved (set to 0)| |"]
3020 #[doc = "| 5 | Reserved (set to 0)| |"]
3021 #[doc = "| 6 | Reserved (set to 0)| |"]
3022 #[doc = "| 7 | Reserved (set to 0)| |"]
3023 MAV_CMD_LOGGING_START = 2510,
3024 #[doc = "Request to stop streaming log data over MAVLink"]
3025 #[doc = ""]
3026 #[doc = "# Parameters"]
3027 #[doc = ""]
3028 #[doc = "| Parameter | Description |"]
3029 #[doc = "| --------- | ----------- |"]
3030 #[doc = "| 1 | Reserved (set to 0)|"]
3031 #[doc = "| 2 | Reserved (set to 0)|"]
3032 #[doc = "| 3 | Reserved (set to 0)|"]
3033 #[doc = "| 4 | Reserved (set to 0)|"]
3034 #[doc = "| 5 | Reserved (set to 0)|"]
3035 #[doc = "| 6 | Reserved (set to 0)|"]
3036 #[doc = "| 7 | Reserved (set to 0)|"]
3037 MAV_CMD_LOGGING_STOP = 2511,
3038 #[doc = ""]
3039 #[doc = "# Parameters"]
3040 #[doc = ""]
3041 #[doc = "| Parameter | Description | Values |"]
3042 #[doc = "| --------- | ----------- | ------ |"]
3043 #[doc = "| 1 (Landing Gear ID)| Landing gear ID (default: 0, -1 for all)| -1, 0, .. |"]
3044 #[doc = "| 2 (Landing Gear Position)| Landing gear position (Down: 0, Up: 1, NaN for no change)| |"]
3045 #[doc = "| 3 | | Reserved (use NaN) |"]
3046 #[doc = "| 4 | | Reserved (use NaN) |"]
3047 #[doc = "| 5 | | |"]
3048 #[doc = "| 6 | | |"]
3049 #[doc = "| 7 | | Reserved (use NaN) |"]
3050 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
3051 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
3052 #[doc = ""]
3053 #[doc = "# Parameters"]
3054 #[doc = ""]
3055 #[doc = "| Parameter | Description | Values |"]
3056 #[doc = "| --------- | ----------- | ------ |"]
3057 #[doc = "| 1 (Enable)| Control transmission over high latency telemetry (0: stop, 1: start)| 0, 1 |"]
3058 #[doc = "| 2 | Empty | |"]
3059 #[doc = "| 3 | Empty | |"]
3060 #[doc = "| 4 | Empty | |"]
3061 #[doc = "| 5 | Empty | |"]
3062 #[doc = "| 6 | Empty | |"]
3063 #[doc = "| 7 | Empty | |"]
3064 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
3065 #[doc = "Create a panorama at the current position"]
3066 #[doc = ""]
3067 #[doc = "# Parameters"]
3068 #[doc = ""]
3069 #[doc = "| Parameter | Description | Units |"]
3070 #[doc = "| --------- | ----------- | ----- |"]
3071 #[doc = "| 1 (Horizontal Angle)| Viewing angle horizontal of the panorama (+- 0.5 the total angle)| deg |"]
3072 #[doc = "| 2 (Vertical Angle)| Viewing angle vertical of panorama.| deg |"]
3073 #[doc = "| 3 (Horizontal Speed)| Speed of the horizontal rotation.| deg/s |"]
3074 #[doc = "| 4 (Vertical Speed)| Speed of the vertical rotation.| deg/s |"]
3075 MAV_CMD_PANORAMA_CREATE = 2800,
3076 #[doc = "Request VTOL transition"]
3077 #[doc = ""]
3078 #[doc = "# Parameters"]
3079 #[doc = ""]
3080 #[doc = "| Parameter | Description | Values |"]
3081 #[doc = "| --------- | ----------- | ------ |"]
3082 #[doc = "| 1 (State) | The target VTOL state. For normal transitions, only MAV_VTOL_STATE_MC and MAV_VTOL_STATE_FW can be used.| [`MavVtolState`] |"]
3083 #[doc = "| 2 (Immediate)| Force immediate transition to the specified MAV_VTOL_STATE. 1: Force immediate, 0: normal transition. Can be used, for example, to trigger an emergency \"Quadchute\". Caution: Can be dangerous/damage vehicle, depending on autopilot implementation of this command.| |"]
3084 MAV_CMD_DO_VTOL_TRANSITION = 3000,
3085 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
3086 #[doc = ""]
3087 #[doc = "# Parameters"]
3088 #[doc = ""]
3089 #[doc = "| Parameter | Description | Values |"]
3090 #[doc = "| --------- | ----------- | ------ |"]
3091 #[doc = "| 1 (System ID)| Vehicle system id, this way ground station can request arm authorization on behalf of any vehicle| 0, 1, .. , 255 |"]
3092 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
3093 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
3094 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
3095 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
3096 #[doc = ""]
3097 #[doc = "# Parameters"]
3098 #[doc = ""]
3099 #[doc = "| Parameter | Description | Units |"]
3100 #[doc = "| --------- | ----------- | ----- |"]
3101 #[doc = "| 1 (Radius)| Radius of desired circle in CIRCLE_MODE| m |"]
3102 #[doc = "| 2 | User defined| |"]
3103 #[doc = "| 3 | User defined| |"]
3104 #[doc = "| 4 | User defined| |"]
3105 #[doc = "| 5 (Latitude)| Target latitude of center of circle in CIRCLE_MODE| degE7 |"]
3106 #[doc = "| 6 (Longitude)| Target longitude of center of circle in CIRCLE_MODE| degE7 |"]
3107 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
3108 #[doc = "Delay mission state machine until gate has been reached."]
3109 #[doc = ""]
3110 #[doc = "# Parameters"]
3111 #[doc = ""]
3112 #[doc = "| Parameter | Description | Values | Units |"]
3113 #[doc = "| --------- | ----------- | ------ | ----- |"]
3114 #[doc = "| 1 (Geometry)| Geometry: 0: orthogonal to path between previous and next waypoint.| 0, 1, .. | |"]
3115 #[doc = "| 2 (UseAltitude)| Altitude: 0: ignore altitude| 0, 1 | |"]
3116 #[doc = "| 3 | Empty | | |"]
3117 #[doc = "| 4 | Empty | | |"]
3118 #[doc = "| 5 (Latitude)| Latitude | | |"]
3119 #[doc = "| 6 (Longitude)| Longitude | | |"]
3120 #[doc = "| 7 (Altitude)| Altitude | | m |"]
3121 MAV_CMD_CONDITION_GATE = 4501,
3122 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
3123 #[doc = ""]
3124 #[doc = "# Parameters"]
3125 #[doc = ""]
3126 #[doc = "| Parameter | Description | Units |"]
3127 #[doc = "| --------- | ----------- | ----- |"]
3128 #[doc = "| 1 | Reserved | |"]
3129 #[doc = "| 2 | Reserved | |"]
3130 #[doc = "| 3 | Reserved | |"]
3131 #[doc = "| 4 | Reserved | |"]
3132 #[doc = "| 5 (Latitude)| Latitude | |"]
3133 #[doc = "| 6 (Longitude)| Longitude | |"]
3134 #[doc = "| 7 (Altitude)| Altitude | m |"]
3135 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
3136 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
3137 #[doc = ""]
3138 #[doc = "# Parameters"]
3139 #[doc = ""]
3140 #[doc = "| Parameter | Description | Values |"]
3141 #[doc = "| --------- | ----------- | ------ |"]
3142 #[doc = "| 1 (Vertex Count)| Polygon vertex count. This is the number of vertices in the current polygon (all vertices will have the same number).| 3, 4, .. |"]
3143 #[doc = "| 2 (Inclusion Group)| Vehicle must be inside ALL inclusion zones in a single group, vehicle must be inside at least one group, must be the same for all points in each polygon| 0, 1, .. |"]
3144 #[doc = "| 3 | Reserved | |"]
3145 #[doc = "| 4 | Reserved | |"]
3146 #[doc = "| 5 (Latitude)| Latitude | |"]
3147 #[doc = "| 6 (Longitude)| Longitude | |"]
3148 #[doc = "| 7 | Reserved | |"]
3149 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
3150 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
3151 #[doc = ""]
3152 #[doc = "# Parameters"]
3153 #[doc = ""]
3154 #[doc = "| Parameter | Description | Values |"]
3155 #[doc = "| --------- | ----------- | ------ |"]
3156 #[doc = "| 1 (Vertex Count)| Polygon vertex count. This is the number of vertices in the current polygon (all vertices will have the same number).| 3, 4, .. |"]
3157 #[doc = "| 2 | Reserved | |"]
3158 #[doc = "| 3 | Reserved | |"]
3159 #[doc = "| 4 | Reserved | |"]
3160 #[doc = "| 5 (Latitude)| Latitude | |"]
3161 #[doc = "| 6 (Longitude)| Longitude | |"]
3162 #[doc = "| 7 | Reserved | |"]
3163 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
3164 #[doc = "Circular fence area. The vehicle must stay inside this area."]
3165 #[doc = ""]
3166 #[doc = "# Parameters"]
3167 #[doc = ""]
3168 #[doc = "| Parameter | Description | Values | Units |"]
3169 #[doc = "| --------- | ----------- | ------ | ----- |"]
3170 #[doc = "| 1 (Radius)| Radius. | | m |"]
3171 #[doc = "| 2 (Inclusion Group)| Vehicle must be inside ALL inclusion zones in a single group, vehicle must be inside at least one group| 0, 1, .. | |"]
3172 #[doc = "| 3 | Reserved | | |"]
3173 #[doc = "| 4 | Reserved | | |"]
3174 #[doc = "| 5 (Latitude)| Latitude | | |"]
3175 #[doc = "| 6 (Longitude)| Longitude | | |"]
3176 #[doc = "| 7 | Reserved | | |"]
3177 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
3178 #[doc = "Circular fence area. The vehicle must stay outside this area."]
3179 #[doc = ""]
3180 #[doc = "# Parameters"]
3181 #[doc = ""]
3182 #[doc = "| Parameter | Description | Units |"]
3183 #[doc = "| --------- | ----------- | ----- |"]
3184 #[doc = "| 1 (Radius)| Radius. | m |"]
3185 #[doc = "| 2 | Reserved | |"]
3186 #[doc = "| 3 | Reserved | |"]
3187 #[doc = "| 4 | Reserved | |"]
3188 #[doc = "| 5 (Latitude)| Latitude | |"]
3189 #[doc = "| 6 (Longitude)| Longitude | |"]
3190 #[doc = "| 7 | Reserved | |"]
3191 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
3192 #[doc = "Rally point. You can have multiple rally points defined."]
3193 #[doc = ""]
3194 #[doc = "# Parameters"]
3195 #[doc = ""]
3196 #[doc = "| Parameter | Description | Units |"]
3197 #[doc = "| --------- | ----------- | ----- |"]
3198 #[doc = "| 1 | Reserved | |"]
3199 #[doc = "| 2 | Reserved | |"]
3200 #[doc = "| 3 | Reserved | |"]
3201 #[doc = "| 4 | Reserved | |"]
3202 #[doc = "| 5 (Latitude)| Latitude | |"]
3203 #[doc = "| 6 (Longitude)| Longitude | |"]
3204 #[doc = "| 7 (Altitude)| Altitude | m |"]
3205 MAV_CMD_NAV_RALLY_POINT = 5100,
3206 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
3207 #[doc = ""]
3208 #[doc = "# Parameters"]
3209 #[doc = ""]
3210 #[doc = "| Parameter | Description |"]
3211 #[doc = "| --------- | ----------- |"]
3212 #[doc = "| 1 | Reserved (set to 0)|"]
3213 #[doc = "| 2 | Reserved (set to 0)|"]
3214 #[doc = "| 3 | Reserved (set to 0)|"]
3215 #[doc = "| 4 | Reserved (set to 0)|"]
3216 #[doc = "| 5 | Reserved (set to 0)|"]
3217 #[doc = "| 6 | Reserved (set to 0)|"]
3218 #[doc = "| 7 | Reserved (set to 0)|"]
3219 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
3220 #[doc = "Change state of safety switch."]
3221 #[doc = ""]
3222 #[doc = "# Parameters"]
3223 #[doc = ""]
3224 #[doc = "| Parameter | Description | Values |"]
3225 #[doc = "| --------- | ----------- | ------ |"]
3226 #[doc = "| 1 (Desired State)| New safety switch state.| [`SafetySwitchState`] |"]
3227 #[doc = "| 2 | Empty. | |"]
3228 #[doc = "| 3 | Empty. | |"]
3229 #[doc = "| 4 | Empty | |"]
3230 #[doc = "| 5 | Empty. | |"]
3231 #[doc = "| 6 | Empty. | |"]
3232 #[doc = "| 7 | Empty. | |"]
3233 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
3234 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
3235 #[doc = ""]
3236 #[doc = "# Parameters"]
3237 #[doc = ""]
3238 #[doc = "| Parameter | Description |"]
3239 #[doc = "| --------- | ----------- |"]
3240 #[doc = "| 1 | Reserved (set to 0)|"]
3241 #[doc = "| 2 | Reserved (set to 0)|"]
3242 #[doc = "| 3 | Reserved (set to 0)|"]
3243 #[doc = "| 4 | Reserved (set to 0)|"]
3244 #[doc = "| 5 | Reserved (set to 0)|"]
3245 #[doc = "| 6 | Reserved (set to 0)|"]
3246 #[doc = "| 7 | Reserved (set to 0)|"]
3247 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
3248 #[deprecated = " (Deprecated since 2021-06)"]
3249 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
3250 #[doc = ""]
3251 #[doc = "# Parameters"]
3252 #[doc = ""]
3253 #[doc = "| Parameter | Description | Values | Units |"]
3254 #[doc = "| --------- | ----------- | ------ | ----- |"]
3255 #[doc = "| 1 (Operation Mode)| Operation mode. 0: prepare single payload deploy (overwriting previous requests), but do not execute it. 1: execute payload deploy immediately (rejecting further deploy commands during execution, but allowing abort). 2: add payload deploy to existing deployment list.| 0, 1, 2 | |"]
3256 #[doc = "| 2 (Approach Vector)| Desired approach vector in compass heading. A negative value indicates the system can define the approach vector at will.| -1 .. 360 | deg |"]
3257 #[doc = "| 3 (Ground Speed)| Desired ground speed at release time. This can be overridden by the airframe in case it needs to meet minimum airspeed. A negative value indicates the system can define the ground speed at will.| ≥ -1 | |"]
3258 #[doc = "| 4 (Altitude Clearance)| Minimum altitude clearance to the release position. A negative value indicates the system can define the clearance at will.| ≥ -1 | m |"]
3259 #[doc = "| 5 (Latitude)| Latitude. | | degE7 |"]
3260 #[doc = "| 6 (Longitude)| Longitude. | | degE7 |"]
3261 #[doc = "| 7 (Altitude)| Altitude (MSL)| | m |"]
3262 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
3263 #[deprecated = " (Deprecated since 2021-06)"]
3264 #[doc = "Control the payload deployment."]
3265 #[doc = ""]
3266 #[doc = "# Parameters"]
3267 #[doc = ""]
3268 #[doc = "| Parameter | Description | Values |"]
3269 #[doc = "| --------- | ----------- | ------ |"]
3270 #[doc = "| 1 (Operation Mode)| Operation mode. 0: Abort deployment, continue normal mission. 1: switch to payload deployment mode. 100: delete first payload deployment request. 101: delete all payload deployment requests.| 0, 1, .. , 101 |"]
3271 #[doc = "| 2 | Reserved | |"]
3272 #[doc = "| 3 | Reserved | |"]
3273 #[doc = "| 4 | Reserved | |"]
3274 #[doc = "| 5 | Reserved | |"]
3275 #[doc = "| 6 | Reserved | |"]
3276 #[doc = "| 7 | Reserved | |"]
3277 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
3278 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
3279 #[doc = ""]
3280 #[doc = "# Parameters"]
3281 #[doc = ""]
3282 #[doc = "| Parameter | Description | Units |"]
3283 #[doc = "| --------- | ----------- | ----- |"]
3284 #[doc = "| 1 (Yaw) | Yaw of vehicle in earth frame.| deg |"]
3285 #[doc = "| 2 (CompassMask)| CompassMask, 0 for all.| |"]
3286 #[doc = "| 3 (Latitude)| Latitude. | deg |"]
3287 #[doc = "| 4 (Longitude)| Longitude. | deg |"]
3288 #[doc = "| 5 | Empty. | |"]
3289 #[doc = "| 6 | Empty. | |"]
3290 #[doc = "| 7 | Empty. | |"]
3291 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
3292 #[doc = "Command to operate winch."]
3293 #[doc = ""]
3294 #[doc = "# Parameters"]
3295 #[doc = ""]
3296 #[doc = "| Parameter | Description | Values | Units |"]
3297 #[doc = "| --------- | ----------- | ------ | ----- |"]
3298 #[doc = "| 1 (Instance)| Winch instance number.| 1, 2, .. | |"]
3299 #[doc = "| 2 (Action)| Action to perform.| [`WinchActions`] | |"]
3300 #[doc = "| 3 (Length)| Length of line to release (negative to wind).| | m |"]
3301 #[doc = "| 4 (Rate) | Release rate (negative to wind).| | m/s |"]
3302 #[doc = "| 5 | Empty. | | |"]
3303 #[doc = "| 6 | Empty. | | |"]
3304 #[doc = "| 7 | Empty. | | |"]
3305 MAV_CMD_DO_WINCH = 42600,
3306 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
3307 #[doc = ""]
3308 #[doc = "# Parameters"]
3309 #[doc = ""]
3310 #[doc = "| Parameter | Description | Units |"]
3311 #[doc = "| --------- | ----------- | ----- |"]
3312 #[doc = "| 1 (transmission_time)| Timestamp that this message was sent as a time in the transmitters time domain. The sender should wrap this time back to zero based on required timing accuracy for the application and the limitations of a 32 bit float. For example, wrapping at 10 hours would give approximately 1ms accuracy. Recipient must handle time wrap in any timing jitter correction applied to this field. Wrap rollover time should not be at not more than 250 seconds, which would give approximately 10 microsecond accuracy.| s |"]
3313 #[doc = "| 2 (processing_time)| The time spent in processing the sensor data that is the basis for this position. The recipient can use this to improve time alignment of the data. Set to zero if not known.| s |"]
3314 #[doc = "| 3 (accuracy)| estimated one standard deviation accuracy of the measurement. Set to NaN if not known.| |"]
3315 #[doc = "| 4 | Empty | |"]
3316 #[doc = "| 5 (Latitude)| Latitude | |"]
3317 #[doc = "| 6 (Longitude)| Longitude | |"]
3318 #[doc = "| 7 (Altitude)| Altitude, not used. Should be sent as NaN. May be supported in a future version of this message.| m |"]
3319 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
3320 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
3321 #[doc = ""]
3322 #[doc = "# Parameters"]
3323 #[doc = ""]
3324 #[doc = "| Parameter | Description | Units |"]
3325 #[doc = "| --------- | ----------- | ----- |"]
3326 #[doc = "| 1 | User defined| |"]
3327 #[doc = "| 2 | User defined| |"]
3328 #[doc = "| 3 | User defined| |"]
3329 #[doc = "| 4 | User defined| |"]
3330 #[doc = "| 5 (Latitude)| Latitude unscaled| |"]
3331 #[doc = "| 6 (Longitude)| Longitude unscaled| |"]
3332 #[doc = "| 7 (Altitude)| Altitude (MSL)| m |"]
3333 MAV_CMD_WAYPOINT_USER_1 = 31000,
3334 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
3335 #[doc = ""]
3336 #[doc = "# Parameters"]
3337 #[doc = ""]
3338 #[doc = "| Parameter | Description | Units |"]
3339 #[doc = "| --------- | ----------- | ----- |"]
3340 #[doc = "| 1 | User defined| |"]
3341 #[doc = "| 2 | User defined| |"]
3342 #[doc = "| 3 | User defined| |"]
3343 #[doc = "| 4 | User defined| |"]
3344 #[doc = "| 5 (Latitude)| Latitude unscaled| |"]
3345 #[doc = "| 6 (Longitude)| Longitude unscaled| |"]
3346 #[doc = "| 7 (Altitude)| Altitude (MSL)| m |"]
3347 MAV_CMD_WAYPOINT_USER_2 = 31001,
3348 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
3349 #[doc = ""]
3350 #[doc = "# Parameters"]
3351 #[doc = ""]
3352 #[doc = "| Parameter | Description | Units |"]
3353 #[doc = "| --------- | ----------- | ----- |"]
3354 #[doc = "| 1 | User defined| |"]
3355 #[doc = "| 2 | User defined| |"]
3356 #[doc = "| 3 | User defined| |"]
3357 #[doc = "| 4 | User defined| |"]
3358 #[doc = "| 5 (Latitude)| Latitude unscaled| |"]
3359 #[doc = "| 6 (Longitude)| Longitude unscaled| |"]
3360 #[doc = "| 7 (Altitude)| Altitude (MSL)| m |"]
3361 MAV_CMD_WAYPOINT_USER_3 = 31002,
3362 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
3363 #[doc = ""]
3364 #[doc = "# Parameters"]
3365 #[doc = ""]
3366 #[doc = "| Parameter | Description | Units |"]
3367 #[doc = "| --------- | ----------- | ----- |"]
3368 #[doc = "| 1 | User defined| |"]
3369 #[doc = "| 2 | User defined| |"]
3370 #[doc = "| 3 | User defined| |"]
3371 #[doc = "| 4 | User defined| |"]
3372 #[doc = "| 5 (Latitude)| Latitude unscaled| |"]
3373 #[doc = "| 6 (Longitude)| Longitude unscaled| |"]
3374 #[doc = "| 7 (Altitude)| Altitude (MSL)| m |"]
3375 MAV_CMD_WAYPOINT_USER_4 = 31003,
3376 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
3377 #[doc = ""]
3378 #[doc = "# Parameters"]
3379 #[doc = ""]
3380 #[doc = "| Parameter | Description | Units |"]
3381 #[doc = "| --------- | ----------- | ----- |"]
3382 #[doc = "| 1 | User defined| |"]
3383 #[doc = "| 2 | User defined| |"]
3384 #[doc = "| 3 | User defined| |"]
3385 #[doc = "| 4 | User defined| |"]
3386 #[doc = "| 5 (Latitude)| Latitude unscaled| |"]
3387 #[doc = "| 6 (Longitude)| Longitude unscaled| |"]
3388 #[doc = "| 7 (Altitude)| Altitude (MSL)| m |"]
3389 MAV_CMD_WAYPOINT_USER_5 = 31004,
3390 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
3391 #[doc = ""]
3392 #[doc = "# Parameters"]
3393 #[doc = ""]
3394 #[doc = "| Parameter | Description | Units |"]
3395 #[doc = "| --------- | ----------- | ----- |"]
3396 #[doc = "| 1 | User defined| |"]
3397 #[doc = "| 2 | User defined| |"]
3398 #[doc = "| 3 | User defined| |"]
3399 #[doc = "| 4 | User defined| |"]
3400 #[doc = "| 5 (Latitude)| Latitude unscaled| |"]
3401 #[doc = "| 6 (Longitude)| Longitude unscaled| |"]
3402 #[doc = "| 7 (Altitude)| Altitude (MSL)| m |"]
3403 MAV_CMD_SPATIAL_USER_1 = 31005,
3404 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
3405 #[doc = ""]
3406 #[doc = "# Parameters"]
3407 #[doc = ""]
3408 #[doc = "| Parameter | Description | Units |"]
3409 #[doc = "| --------- | ----------- | ----- |"]
3410 #[doc = "| 1 | User defined| |"]
3411 #[doc = "| 2 | User defined| |"]
3412 #[doc = "| 3 | User defined| |"]
3413 #[doc = "| 4 | User defined| |"]
3414 #[doc = "| 5 (Latitude)| Latitude unscaled| |"]
3415 #[doc = "| 6 (Longitude)| Longitude unscaled| |"]
3416 #[doc = "| 7 (Altitude)| Altitude (MSL)| m |"]
3417 MAV_CMD_SPATIAL_USER_2 = 31006,
3418 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
3419 #[doc = ""]
3420 #[doc = "# Parameters"]
3421 #[doc = ""]
3422 #[doc = "| Parameter | Description | Units |"]
3423 #[doc = "| --------- | ----------- | ----- |"]
3424 #[doc = "| 1 | User defined| |"]
3425 #[doc = "| 2 | User defined| |"]
3426 #[doc = "| 3 | User defined| |"]
3427 #[doc = "| 4 | User defined| |"]
3428 #[doc = "| 5 (Latitude)| Latitude unscaled| |"]
3429 #[doc = "| 6 (Longitude)| Longitude unscaled| |"]
3430 #[doc = "| 7 (Altitude)| Altitude (MSL)| m |"]
3431 MAV_CMD_SPATIAL_USER_3 = 31007,
3432 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
3433 #[doc = ""]
3434 #[doc = "# Parameters"]
3435 #[doc = ""]
3436 #[doc = "| Parameter | Description | Units |"]
3437 #[doc = "| --------- | ----------- | ----- |"]
3438 #[doc = "| 1 | User defined| |"]
3439 #[doc = "| 2 | User defined| |"]
3440 #[doc = "| 3 | User defined| |"]
3441 #[doc = "| 4 | User defined| |"]
3442 #[doc = "| 5 (Latitude)| Latitude unscaled| |"]
3443 #[doc = "| 6 (Longitude)| Longitude unscaled| |"]
3444 #[doc = "| 7 (Altitude)| Altitude (MSL)| m |"]
3445 MAV_CMD_SPATIAL_USER_4 = 31008,
3446 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
3447 #[doc = ""]
3448 #[doc = "# Parameters"]
3449 #[doc = ""]
3450 #[doc = "| Parameter | Description | Units |"]
3451 #[doc = "| --------- | ----------- | ----- |"]
3452 #[doc = "| 1 | User defined| |"]
3453 #[doc = "| 2 | User defined| |"]
3454 #[doc = "| 3 | User defined| |"]
3455 #[doc = "| 4 | User defined| |"]
3456 #[doc = "| 5 (Latitude)| Latitude unscaled| |"]
3457 #[doc = "| 6 (Longitude)| Longitude unscaled| |"]
3458 #[doc = "| 7 (Altitude)| Altitude (MSL)| m |"]
3459 MAV_CMD_SPATIAL_USER_5 = 31009,
3460 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
3461 #[doc = ""]
3462 #[doc = "# Parameters"]
3463 #[doc = ""]
3464 #[doc = "| Parameter | Description |"]
3465 #[doc = "| --------- | ----------- |"]
3466 #[doc = "| 1 | User defined|"]
3467 #[doc = "| 2 | User defined|"]
3468 #[doc = "| 3 | User defined|"]
3469 #[doc = "| 4 | User defined|"]
3470 #[doc = "| 5 | User defined|"]
3471 #[doc = "| 6 | User defined|"]
3472 #[doc = "| 7 | User defined|"]
3473 MAV_CMD_USER_1 = 31010,
3474 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
3475 #[doc = ""]
3476 #[doc = "# Parameters"]
3477 #[doc = ""]
3478 #[doc = "| Parameter | Description |"]
3479 #[doc = "| --------- | ----------- |"]
3480 #[doc = "| 1 | User defined|"]
3481 #[doc = "| 2 | User defined|"]
3482 #[doc = "| 3 | User defined|"]
3483 #[doc = "| 4 | User defined|"]
3484 #[doc = "| 5 | User defined|"]
3485 #[doc = "| 6 | User defined|"]
3486 #[doc = "| 7 | User defined|"]
3487 MAV_CMD_USER_2 = 31011,
3488 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
3489 #[doc = ""]
3490 #[doc = "# Parameters"]
3491 #[doc = ""]
3492 #[doc = "| Parameter | Description |"]
3493 #[doc = "| --------- | ----------- |"]
3494 #[doc = "| 1 | User defined|"]
3495 #[doc = "| 2 | User defined|"]
3496 #[doc = "| 3 | User defined|"]
3497 #[doc = "| 4 | User defined|"]
3498 #[doc = "| 5 | User defined|"]
3499 #[doc = "| 6 | User defined|"]
3500 #[doc = "| 7 | User defined|"]
3501 MAV_CMD_USER_3 = 31012,
3502 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
3503 #[doc = ""]
3504 #[doc = "# Parameters"]
3505 #[doc = ""]
3506 #[doc = "| Parameter | Description |"]
3507 #[doc = "| --------- | ----------- |"]
3508 #[doc = "| 1 | User defined|"]
3509 #[doc = "| 2 | User defined|"]
3510 #[doc = "| 3 | User defined|"]
3511 #[doc = "| 4 | User defined|"]
3512 #[doc = "| 5 | User defined|"]
3513 #[doc = "| 6 | User defined|"]
3514 #[doc = "| 7 | User defined|"]
3515 MAV_CMD_USER_4 = 31013,
3516 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
3517 #[doc = ""]
3518 #[doc = "# Parameters"]
3519 #[doc = ""]
3520 #[doc = "| Parameter | Description |"]
3521 #[doc = "| --------- | ----------- |"]
3522 #[doc = "| 1 | User defined|"]
3523 #[doc = "| 2 | User defined|"]
3524 #[doc = "| 3 | User defined|"]
3525 #[doc = "| 4 | User defined|"]
3526 #[doc = "| 5 | User defined|"]
3527 #[doc = "| 6 | User defined|"]
3528 #[doc = "| 7 | User defined|"]
3529 MAV_CMD_USER_5 = 31014,
3530 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
3531 #[doc = ""]
3532 #[doc = "# Parameters"]
3533 #[doc = ""]
3534 #[doc = "| Parameter | Description |"]
3535 #[doc = "| --------- | ----------- |"]
3536 #[doc = "| 1 (bus) | Bus number (0 to disable forwarding, 1 for first bus, 2 for 2nd bus, 3 for 3rd bus).|"]
3537 #[doc = "| 2 | Empty. |"]
3538 #[doc = "| 3 | Empty. |"]
3539 #[doc = "| 4 | Empty. |"]
3540 #[doc = "| 5 | Empty. |"]
3541 #[doc = "| 6 | Empty. |"]
3542 #[doc = "| 7 | Empty. |"]
3543 MAV_CMD_CAN_FORWARD = 32000,
3544}
3545impl MavCmd {
3546 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
3547}
3548impl Default for MavCmd {
3549 fn default() -> Self {
3550 Self::DEFAULT
3551 }
3552}
3553#[cfg_attr(feature = "ts", derive(TS))]
3554#[cfg_attr(feature = "ts", ts(export))]
3555#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3556#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3557#[cfg_attr(feature = "serde", serde(tag = "type"))]
3558#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3559#[repr(u32)]
3560#[doc = "Possible actions an aircraft can take to avoid a collision."]
3561pub enum MavCollisionAction {
3562 #[doc = "Ignore any potential collisions"]
3563 MAV_COLLISION_ACTION_NONE = 0,
3564 #[doc = "Report potential collision"]
3565 MAV_COLLISION_ACTION_REPORT = 1,
3566 #[doc = "Ascend or Descend to avoid threat"]
3567 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
3568 #[doc = "Move horizontally to avoid threat"]
3569 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
3570 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
3571 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
3572 #[doc = "Aircraft to fly directly back to its launch point"]
3573 MAV_COLLISION_ACTION_RTL = 5,
3574 #[doc = "Aircraft to stop in place"]
3575 MAV_COLLISION_ACTION_HOVER = 6,
3576}
3577impl MavCollisionAction {
3578 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
3579}
3580impl Default for MavCollisionAction {
3581 fn default() -> Self {
3582 Self::DEFAULT
3583 }
3584}
3585#[cfg_attr(feature = "ts", derive(TS))]
3586#[cfg_attr(feature = "ts", ts(export))]
3587#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3588#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3589#[cfg_attr(feature = "serde", serde(tag = "type"))]
3590#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3591#[repr(u32)]
3592#[doc = "Source of information about this collision."]
3593pub enum MavCollisionSrc {
3594 #[doc = "ID field references ADSB_VEHICLE packets"]
3595 MAV_COLLISION_SRC_ADSB = 0,
3596 #[doc = "ID field references MAVLink SRC ID"]
3597 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
3598}
3599impl MavCollisionSrc {
3600 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
3601}
3602impl Default for MavCollisionSrc {
3603 fn default() -> Self {
3604 Self::DEFAULT
3605 }
3606}
3607#[cfg_attr(feature = "ts", derive(TS))]
3608#[cfg_attr(feature = "ts", ts(export))]
3609#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3610#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3611#[cfg_attr(feature = "serde", serde(tag = "type"))]
3612#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3613#[repr(u32)]
3614#[doc = "Aircraft-rated danger from this threat."]
3615pub enum MavCollisionThreatLevel {
3616 #[doc = "Not a threat"]
3617 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
3618 #[doc = "Craft is mildly concerned about this threat"]
3619 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
3620 #[doc = "Craft is panicking, and may take actions to avoid threat"]
3621 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
3622}
3623impl MavCollisionThreatLevel {
3624 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
3625}
3626impl Default for MavCollisionThreatLevel {
3627 fn default() -> Self {
3628 Self::DEFAULT
3629 }
3630}
3631#[cfg_attr(feature = "ts", derive(TS))]
3632#[cfg_attr(feature = "ts", ts(export))]
3633#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3634#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3635#[cfg_attr(feature = "serde", serde(tag = "type"))]
3636#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3637#[repr(u32)]
3638#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
3639pub enum MavComponent {
3640 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
3641 MAV_COMP_ID_ALL = 0,
3642 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
3643 MAV_COMP_ID_AUTOPILOT1 = 1,
3644 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3645 MAV_COMP_ID_USER1 = 25,
3646 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3647 MAV_COMP_ID_USER2 = 26,
3648 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3649 MAV_COMP_ID_USER3 = 27,
3650 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3651 MAV_COMP_ID_USER4 = 28,
3652 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3653 MAV_COMP_ID_USER5 = 29,
3654 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3655 MAV_COMP_ID_USER6 = 30,
3656 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3657 MAV_COMP_ID_USER7 = 31,
3658 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3659 MAV_COMP_ID_USER8 = 32,
3660 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3661 MAV_COMP_ID_USER9 = 33,
3662 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3663 MAV_COMP_ID_USER10 = 34,
3664 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3665 MAV_COMP_ID_USER11 = 35,
3666 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3667 MAV_COMP_ID_USER12 = 36,
3668 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3669 MAV_COMP_ID_USER13 = 37,
3670 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3671 MAV_COMP_ID_USER14 = 38,
3672 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3673 MAV_COMP_ID_USER15 = 39,
3674 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3675 MAV_COMP_ID_USER16 = 40,
3676 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3677 MAV_COMP_ID_USER17 = 41,
3678 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3679 MAV_COMP_ID_USER18 = 42,
3680 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3681 MAV_COMP_ID_USER19 = 43,
3682 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3683 MAV_COMP_ID_USER20 = 44,
3684 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3685 MAV_COMP_ID_USER21 = 45,
3686 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3687 MAV_COMP_ID_USER22 = 46,
3688 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3689 MAV_COMP_ID_USER23 = 47,
3690 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3691 MAV_COMP_ID_USER24 = 48,
3692 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3693 MAV_COMP_ID_USER25 = 49,
3694 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3695 MAV_COMP_ID_USER26 = 50,
3696 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3697 MAV_COMP_ID_USER27 = 51,
3698 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3699 MAV_COMP_ID_USER28 = 52,
3700 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3701 MAV_COMP_ID_USER29 = 53,
3702 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3703 MAV_COMP_ID_USER30 = 54,
3704 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3705 MAV_COMP_ID_USER31 = 55,
3706 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3707 MAV_COMP_ID_USER32 = 56,
3708 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3709 MAV_COMP_ID_USER33 = 57,
3710 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3711 MAV_COMP_ID_USER34 = 58,
3712 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3713 MAV_COMP_ID_USER35 = 59,
3714 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3715 MAV_COMP_ID_USER36 = 60,
3716 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3717 MAV_COMP_ID_USER37 = 61,
3718 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3719 MAV_COMP_ID_USER38 = 62,
3720 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3721 MAV_COMP_ID_USER39 = 63,
3722 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3723 MAV_COMP_ID_USER40 = 64,
3724 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3725 MAV_COMP_ID_USER41 = 65,
3726 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3727 MAV_COMP_ID_USER42 = 66,
3728 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3729 MAV_COMP_ID_USER43 = 67,
3730 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
3731 MAV_COMP_ID_TELEMETRY_RADIO = 68,
3732 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3733 MAV_COMP_ID_USER45 = 69,
3734 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3735 MAV_COMP_ID_USER46 = 70,
3736 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3737 MAV_COMP_ID_USER47 = 71,
3738 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3739 MAV_COMP_ID_USER48 = 72,
3740 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3741 MAV_COMP_ID_USER49 = 73,
3742 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3743 MAV_COMP_ID_USER50 = 74,
3744 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3745 MAV_COMP_ID_USER51 = 75,
3746 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3747 MAV_COMP_ID_USER52 = 76,
3748 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3749 MAV_COMP_ID_USER53 = 77,
3750 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3751 MAV_COMP_ID_USER54 = 78,
3752 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3753 MAV_COMP_ID_USER55 = 79,
3754 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3755 MAV_COMP_ID_USER56 = 80,
3756 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3757 MAV_COMP_ID_USER57 = 81,
3758 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3759 MAV_COMP_ID_USER58 = 82,
3760 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3761 MAV_COMP_ID_USER59 = 83,
3762 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3763 MAV_COMP_ID_USER60 = 84,
3764 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3765 MAV_COMP_ID_USER61 = 85,
3766 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3767 MAV_COMP_ID_USER62 = 86,
3768 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3769 MAV_COMP_ID_USER63 = 87,
3770 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3771 MAV_COMP_ID_USER64 = 88,
3772 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3773 MAV_COMP_ID_USER65 = 89,
3774 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3775 MAV_COMP_ID_USER66 = 90,
3776 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3777 MAV_COMP_ID_USER67 = 91,
3778 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3779 MAV_COMP_ID_USER68 = 92,
3780 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3781 MAV_COMP_ID_USER69 = 93,
3782 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3783 MAV_COMP_ID_USER70 = 94,
3784 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3785 MAV_COMP_ID_USER71 = 95,
3786 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3787 MAV_COMP_ID_USER72 = 96,
3788 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3789 MAV_COMP_ID_USER73 = 97,
3790 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3791 MAV_COMP_ID_USER74 = 98,
3792 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3793 MAV_COMP_ID_USER75 = 99,
3794 #[doc = "Camera #1."]
3795 MAV_COMP_ID_CAMERA = 100,
3796 #[doc = "Camera #2."]
3797 MAV_COMP_ID_CAMERA2 = 101,
3798 #[doc = "Camera #3."]
3799 MAV_COMP_ID_CAMERA3 = 102,
3800 #[doc = "Camera #4."]
3801 MAV_COMP_ID_CAMERA4 = 103,
3802 #[doc = "Camera #5."]
3803 MAV_COMP_ID_CAMERA5 = 104,
3804 #[doc = "Camera #6."]
3805 MAV_COMP_ID_CAMERA6 = 105,
3806 #[doc = "Servo #1."]
3807 MAV_COMP_ID_SERVO1 = 140,
3808 #[doc = "Servo #2."]
3809 MAV_COMP_ID_SERVO2 = 141,
3810 #[doc = "Servo #3."]
3811 MAV_COMP_ID_SERVO3 = 142,
3812 #[doc = "Servo #4."]
3813 MAV_COMP_ID_SERVO4 = 143,
3814 #[doc = "Servo #5."]
3815 MAV_COMP_ID_SERVO5 = 144,
3816 #[doc = "Servo #6."]
3817 MAV_COMP_ID_SERVO6 = 145,
3818 #[doc = "Servo #7."]
3819 MAV_COMP_ID_SERVO7 = 146,
3820 #[doc = "Servo #8."]
3821 MAV_COMP_ID_SERVO8 = 147,
3822 #[doc = "Servo #9."]
3823 MAV_COMP_ID_SERVO9 = 148,
3824 #[doc = "Servo #10."]
3825 MAV_COMP_ID_SERVO10 = 149,
3826 #[doc = "Servo #11."]
3827 MAV_COMP_ID_SERVO11 = 150,
3828 #[doc = "Servo #12."]
3829 MAV_COMP_ID_SERVO12 = 151,
3830 #[doc = "Servo #13."]
3831 MAV_COMP_ID_SERVO13 = 152,
3832 #[doc = "Servo #14."]
3833 MAV_COMP_ID_SERVO14 = 153,
3834 #[doc = "Gimbal #1."]
3835 MAV_COMP_ID_GIMBAL = 154,
3836 #[doc = "Logging component."]
3837 MAV_COMP_ID_LOG = 155,
3838 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
3839 MAV_COMP_ID_ADSB = 156,
3840 #[doc = "On Screen Display (OSD) devices for video links."]
3841 MAV_COMP_ID_OSD = 157,
3842 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
3843 MAV_COMP_ID_PERIPHERAL = 158,
3844 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
3845 #[doc = "Gimbal ID for QX1."]
3846 MAV_COMP_ID_QX1_GIMBAL = 159,
3847 #[doc = "FLARM collision alert component."]
3848 MAV_COMP_ID_FLARM = 160,
3849 #[doc = "Parachute component."]
3850 MAV_COMP_ID_PARACHUTE = 161,
3851 #[doc = "Winch component."]
3852 MAV_COMP_ID_WINCH = 169,
3853 #[doc = "Gimbal #2."]
3854 MAV_COMP_ID_GIMBAL2 = 171,
3855 #[doc = "Gimbal #3."]
3856 MAV_COMP_ID_GIMBAL3 = 172,
3857 #[doc = "Gimbal #4"]
3858 MAV_COMP_ID_GIMBAL4 = 173,
3859 #[doc = "Gimbal #5."]
3860 MAV_COMP_ID_GIMBAL5 = 174,
3861 #[doc = "Gimbal #6."]
3862 MAV_COMP_ID_GIMBAL6 = 175,
3863 #[doc = "Battery #1."]
3864 MAV_COMP_ID_BATTERY = 180,
3865 #[doc = "Battery #2."]
3866 MAV_COMP_ID_BATTERY2 = 181,
3867 #[doc = "CAN over MAVLink client."]
3868 MAV_COMP_ID_MAVCAN = 189,
3869 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
3870 MAV_COMP_ID_MISSIONPLANNER = 190,
3871 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
3872 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
3873 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
3874 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
3875 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
3876 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
3877 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
3878 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
3879 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
3880 MAV_COMP_ID_PATHPLANNER = 195,
3881 #[doc = "Component that plans a collision free path between two points."]
3882 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
3883 #[doc = "Component that provides position estimates using VIO techniques."]
3884 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
3885 #[doc = "Component that manages pairing of vehicle and GCS."]
3886 MAV_COMP_ID_PAIRING_MANAGER = 198,
3887 #[doc = "Inertial Measurement Unit (IMU) #1."]
3888 MAV_COMP_ID_IMU = 200,
3889 #[doc = "Inertial Measurement Unit (IMU) #2."]
3890 MAV_COMP_ID_IMU_2 = 201,
3891 #[doc = "Inertial Measurement Unit (IMU) #3."]
3892 MAV_COMP_ID_IMU_3 = 202,
3893 #[doc = "GPS #1."]
3894 MAV_COMP_ID_GPS = 220,
3895 #[doc = "GPS #2."]
3896 MAV_COMP_ID_GPS2 = 221,
3897 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
3898 MAV_COMP_ID_ODID_TXRX_1 = 236,
3899 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
3900 MAV_COMP_ID_ODID_TXRX_2 = 237,
3901 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
3902 MAV_COMP_ID_ODID_TXRX_3 = 238,
3903 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
3904 MAV_COMP_ID_UDP_BRIDGE = 240,
3905 #[doc = "Component to bridge to UART (i.e. from UDP)."]
3906 MAV_COMP_ID_UART_BRIDGE = 241,
3907 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
3908 MAV_COMP_ID_TUNNEL_NODE = 242,
3909 #[doc = "Illuminator"]
3910 MAV_COMP_ID_ILLUMINATOR = 243,
3911 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
3912 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
3913 MAV_COMP_ID_SYSTEM_CONTROL = 250,
3914}
3915impl MavComponent {
3916 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
3917}
3918impl Default for MavComponent {
3919 fn default() -> Self {
3920 Self::DEFAULT
3921 }
3922}
3923#[cfg_attr(feature = "ts", derive(TS))]
3924#[cfg_attr(feature = "ts", ts(export))]
3925#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3926#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3927#[cfg_attr(feature = "serde", serde(tag = "type"))]
3928#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3929#[repr(u32)]
3930#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
3931#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
3932pub enum MavDataStream {
3933 #[doc = "Enable all data streams"]
3934 MAV_DATA_STREAM_ALL = 0,
3935 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
3936 MAV_DATA_STREAM_RAW_SENSORS = 1,
3937 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
3938 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
3939 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
3940 MAV_DATA_STREAM_RC_CHANNELS = 3,
3941 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
3942 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
3943 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
3944 MAV_DATA_STREAM_POSITION = 6,
3945 #[doc = "Dependent on the autopilot"]
3946 MAV_DATA_STREAM_EXTRA1 = 10,
3947 #[doc = "Dependent on the autopilot"]
3948 MAV_DATA_STREAM_EXTRA2 = 11,
3949 #[doc = "Dependent on the autopilot"]
3950 MAV_DATA_STREAM_EXTRA3 = 12,
3951}
3952impl MavDataStream {
3953 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
3954}
3955impl Default for MavDataStream {
3956 fn default() -> Self {
3957 Self::DEFAULT
3958 }
3959}
3960#[cfg_attr(feature = "ts", derive(TS))]
3961#[cfg_attr(feature = "ts", ts(export))]
3962#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3963#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3964#[cfg_attr(feature = "serde", serde(tag = "type"))]
3965#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3966#[repr(u32)]
3967#[doc = "Enumeration of distance sensor types"]
3968pub enum MavDistanceSensor {
3969 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
3970 MAV_DISTANCE_SENSOR_LASER = 0,
3971 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
3972 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
3973 #[doc = "Infrared rangefinder, e.g. Sharp units"]
3974 MAV_DISTANCE_SENSOR_INFRARED = 2,
3975 #[doc = "Radar type, e.g. uLanding units"]
3976 MAV_DISTANCE_SENSOR_RADAR = 3,
3977 #[doc = "Broken or unknown type, e.g. analog units"]
3978 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
3979}
3980impl MavDistanceSensor {
3981 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
3982}
3983impl Default for MavDistanceSensor {
3984 fn default() -> Self {
3985 Self::DEFAULT
3986 }
3987}
3988#[cfg_attr(feature = "ts", derive(TS))]
3989#[cfg_attr(feature = "ts", ts(export))]
3990#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3991#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3992#[cfg_attr(feature = "serde", serde(tag = "type"))]
3993#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3994#[repr(u32)]
3995#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
3996pub enum MavDoRepositionFlags {
3997 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
3998 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
3999}
4000impl MavDoRepositionFlags {
4001 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
4002}
4003impl Default for MavDoRepositionFlags {
4004 fn default() -> Self {
4005 Self::DEFAULT
4006 }
4007}
4008#[cfg_attr(feature = "ts", derive(TS))]
4009#[cfg_attr(feature = "ts", ts(export))]
4010#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4011#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4012#[cfg_attr(feature = "serde", serde(tag = "type"))]
4013#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4014#[repr(u32)]
4015#[doc = "Enumeration of estimator types"]
4016pub enum MavEstimatorType {
4017 #[doc = "Unknown type of the estimator."]
4018 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
4019 #[doc = "This is a naive estimator without any real covariance feedback."]
4020 MAV_ESTIMATOR_TYPE_NAIVE = 1,
4021 #[doc = "Computer vision based estimate. Might be up to scale."]
4022 MAV_ESTIMATOR_TYPE_VISION = 2,
4023 #[doc = "Visual-inertial estimate."]
4024 MAV_ESTIMATOR_TYPE_VIO = 3,
4025 #[doc = "Plain GPS estimate."]
4026 MAV_ESTIMATOR_TYPE_GPS = 4,
4027 #[doc = "Estimator integrating GPS and inertial sensing."]
4028 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
4029 #[doc = "Estimate from external motion capturing system."]
4030 MAV_ESTIMATOR_TYPE_MOCAP = 6,
4031 #[doc = "Estimator based on lidar sensor input."]
4032 MAV_ESTIMATOR_TYPE_LIDAR = 7,
4033 #[doc = "Estimator on autopilot."]
4034 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
4035}
4036impl MavEstimatorType {
4037 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
4038}
4039impl Default for MavEstimatorType {
4040 fn default() -> Self {
4041 Self::DEFAULT
4042 }
4043}
4044#[cfg_attr(feature = "ts", derive(TS))]
4045#[cfg_attr(feature = "ts", ts(export))]
4046#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4047#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4048#[cfg_attr(feature = "serde", serde(tag = "type"))]
4049#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4050#[repr(u32)]
4051#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
4052pub enum MavEventCurrentSequenceFlags {
4053 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
4054 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
4055}
4056impl MavEventCurrentSequenceFlags {
4057 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
4058}
4059impl Default for MavEventCurrentSequenceFlags {
4060 fn default() -> Self {
4061 Self::DEFAULT
4062 }
4063}
4064#[cfg_attr(feature = "ts", derive(TS))]
4065#[cfg_attr(feature = "ts", ts(export))]
4066#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4067#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4068#[cfg_attr(feature = "serde", serde(tag = "type"))]
4069#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4070#[repr(u32)]
4071#[doc = "Reason for an event error response."]
4072pub enum MavEventErrorReason {
4073 #[doc = "The requested event is not available (anymore)."]
4074 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
4075}
4076impl MavEventErrorReason {
4077 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
4078}
4079impl Default for MavEventErrorReason {
4080 fn default() -> Self {
4081 Self::DEFAULT
4082 }
4083}
4084#[cfg_attr(feature = "ts", derive(TS))]
4085#[cfg_attr(feature = "ts", ts(export))]
4086#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4087#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4088#[cfg_attr(feature = "serde", serde(tag = "type"))]
4089#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4090#[repr(u32)]
4091#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
4092pub enum MavFrame {
4093 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
4094 MAV_FRAME_GLOBAL = 0,
4095 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
4096 MAV_FRAME_LOCAL_NED = 1,
4097 #[doc = "NOT a coordinate frame, indicates a mission command."]
4098 MAV_FRAME_MISSION = 2,
4099 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
4100 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
4101 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
4102 MAV_FRAME_LOCAL_ENU = 4,
4103 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
4104 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
4105 MAV_FRAME_GLOBAL_INT = 5,
4106 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
4107 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
4108 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
4109 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
4110 MAV_FRAME_LOCAL_OFFSET_NED = 7,
4111 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
4112 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
4113 MAV_FRAME_BODY_NED = 8,
4114 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
4115 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
4116 MAV_FRAME_BODY_OFFSET_NED = 9,
4117 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
4118 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
4119 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
4120 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
4121 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
4122 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
4123 MAV_FRAME_BODY_FRD = 12,
4124 #[deprecated = " (Deprecated since 2019-04)"]
4125 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
4126 MAV_FRAME_RESERVED_13 = 13,
4127 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
4128 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
4129 MAV_FRAME_RESERVED_14 = 14,
4130 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
4131 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
4132 MAV_FRAME_RESERVED_15 = 15,
4133 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
4134 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
4135 MAV_FRAME_RESERVED_16 = 16,
4136 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
4137 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
4138 MAV_FRAME_RESERVED_17 = 17,
4139 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
4140 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
4141 MAV_FRAME_RESERVED_18 = 18,
4142 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
4143 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
4144 MAV_FRAME_RESERVED_19 = 19,
4145 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
4146 MAV_FRAME_LOCAL_FRD = 20,
4147 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
4148 MAV_FRAME_LOCAL_FLU = 21,
4149}
4150impl MavFrame {
4151 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
4152}
4153impl Default for MavFrame {
4154 fn default() -> Self {
4155 Self::DEFAULT
4156 }
4157}
4158#[cfg_attr(feature = "ts", derive(TS))]
4159#[cfg_attr(feature = "ts", ts(export))]
4160#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4161#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4162#[cfg_attr(feature = "serde", serde(tag = "type"))]
4163#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4164#[repr(u32)]
4165#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
4166pub enum MavFtpErr {
4167 #[doc = "None: No error"]
4168 MAV_FTP_ERR_NONE = 0,
4169 #[doc = "Fail: Unknown failure"]
4170 MAV_FTP_ERR_FAIL = 1,
4171 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
4172 MAV_FTP_ERR_FAILERRNO = 2,
4173 #[doc = "InvalidDataSize: Payload size is invalid"]
4174 MAV_FTP_ERR_INVALIDDATASIZE = 3,
4175 #[doc = "InvalidSession: Session is not currently open"]
4176 MAV_FTP_ERR_INVALIDSESSION = 4,
4177 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
4178 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
4179 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
4180 MAV_FTP_ERR_EOF = 6,
4181 #[doc = "UnknownCommand: Unknown command / opcode"]
4182 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
4183 #[doc = "FileExists: File/directory already exists"]
4184 MAV_FTP_ERR_FILEEXISTS = 8,
4185 #[doc = "FileProtected: File/directory is write protected"]
4186 MAV_FTP_ERR_FILEPROTECTED = 9,
4187 #[doc = "FileNotFound: File/directory not found"]
4188 MAV_FTP_ERR_FILENOTFOUND = 10,
4189}
4190impl MavFtpErr {
4191 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
4192}
4193impl Default for MavFtpErr {
4194 fn default() -> Self {
4195 Self::DEFAULT
4196 }
4197}
4198#[cfg_attr(feature = "ts", derive(TS))]
4199#[cfg_attr(feature = "ts", ts(export))]
4200#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4201#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4202#[cfg_attr(feature = "serde", serde(tag = "type"))]
4203#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4204#[repr(u32)]
4205#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
4206pub enum MavFtpOpcode {
4207 #[doc = "None. Ignored, always ACKed"]
4208 MAV_FTP_OPCODE_NONE = 0,
4209 #[doc = "TerminateSession: Terminates open Read session"]
4210 MAV_FTP_OPCODE_TERMINATESESSION = 1,
4211 #[doc = "ResetSessions: Terminates all open read sessions"]
4212 MAV_FTP_OPCODE_RESETSESSION = 2,
4213 #[doc = "ListDirectory. List files and directories in path from offset"]
4214 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
4215 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
4216 MAV_FTP_OPCODE_OPENFILERO = 4,
4217 #[doc = "ReadFile: Reads size bytes from offset in session"]
4218 MAV_FTP_OPCODE_READFILE = 5,
4219 #[doc = "CreateFile: Creates file at path for writing, returns session"]
4220 MAV_FTP_OPCODE_CREATEFILE = 6,
4221 #[doc = "WriteFile: Writes size bytes to offset in session"]
4222 MAV_FTP_OPCODE_WRITEFILE = 7,
4223 #[doc = "RemoveFile: Remove file at path"]
4224 MAV_FTP_OPCODE_REMOVEFILE = 8,
4225 #[doc = "CreateDirectory: Creates directory at path"]
4226 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
4227 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
4228 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
4229 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
4230 MAV_FTP_OPCODE_OPENFILEWO = 11,
4231 #[doc = "TruncateFile: Truncate file at path to offset length"]
4232 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
4233 #[doc = "Rename: Rename path1 to path2"]
4234 MAV_FTP_OPCODE_RENAME = 13,
4235 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
4236 MAV_FTP_OPCODE_CALCFILECRC = 14,
4237 #[doc = "BurstReadFile: Burst download session file"]
4238 MAV_FTP_OPCODE_BURSTREADFILE = 15,
4239 #[doc = "ACK: ACK response"]
4240 MAV_FTP_OPCODE_ACK = 128,
4241 #[doc = "NAK: NAK response"]
4242 MAV_FTP_OPCODE_NAK = 129,
4243}
4244impl MavFtpOpcode {
4245 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
4246}
4247impl Default for MavFtpOpcode {
4248 fn default() -> Self {
4249 Self::DEFAULT
4250 }
4251}
4252#[cfg_attr(feature = "ts", derive(TS))]
4253#[cfg_attr(feature = "ts", ts(export))]
4254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4256#[cfg_attr(feature = "serde", serde(tag = "type"))]
4257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4258#[repr(u32)]
4259#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
4260pub enum MavFuelType {
4261 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
4262 MAV_FUEL_TYPE_UNKNOWN = 0,
4263 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
4264 MAV_FUEL_TYPE_LIQUID = 1,
4265 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
4266 MAV_FUEL_TYPE_GAS = 2,
4267}
4268impl MavFuelType {
4269 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
4270}
4271impl Default for MavFuelType {
4272 fn default() -> Self {
4273 Self::DEFAULT
4274 }
4275}
4276bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
4277impl MavGeneratorStatusFlag {
4278 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
4279}
4280impl Default for MavGeneratorStatusFlag {
4281 fn default() -> Self {
4282 Self::DEFAULT
4283 }
4284}
4285#[cfg_attr(feature = "ts", derive(TS))]
4286#[cfg_attr(feature = "ts", ts(export))]
4287#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4288#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4289#[cfg_attr(feature = "serde", serde(tag = "type"))]
4290#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4291#[repr(u32)]
4292#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
4293pub enum MavGoto {
4294 #[doc = "Hold at the current position."]
4295 MAV_GOTO_DO_HOLD = 0,
4296 #[doc = "Continue with the next item in mission execution."]
4297 MAV_GOTO_DO_CONTINUE = 1,
4298 #[doc = "Hold at the current position of the system"]
4299 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
4300 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
4301 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
4302}
4303impl MavGoto {
4304 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
4305}
4306impl Default for MavGoto {
4307 fn default() -> Self {
4308 Self::DEFAULT
4309 }
4310}
4311#[cfg_attr(feature = "ts", derive(TS))]
4312#[cfg_attr(feature = "ts", ts(export))]
4313#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4314#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4315#[cfg_attr(feature = "serde", serde(tag = "type"))]
4316#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4317#[repr(u32)]
4318#[doc = "Enumeration of landed detector states"]
4319pub enum MavLandedState {
4320 #[doc = "MAV landed state is unknown"]
4321 MAV_LANDED_STATE_UNDEFINED = 0,
4322 #[doc = "MAV is landed (on ground)"]
4323 MAV_LANDED_STATE_ON_GROUND = 1,
4324 #[doc = "MAV is in air"]
4325 MAV_LANDED_STATE_IN_AIR = 2,
4326 #[doc = "MAV currently taking off"]
4327 MAV_LANDED_STATE_TAKEOFF = 3,
4328 #[doc = "MAV currently landing"]
4329 MAV_LANDED_STATE_LANDING = 4,
4330}
4331impl MavLandedState {
4332 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
4333}
4334impl Default for MavLandedState {
4335 fn default() -> Self {
4336 Self::DEFAULT
4337 }
4338}
4339#[cfg_attr(feature = "ts", derive(TS))]
4340#[cfg_attr(feature = "ts", ts(export))]
4341#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4342#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4343#[cfg_attr(feature = "serde", serde(tag = "type"))]
4344#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4345#[repr(u32)]
4346#[doc = "Result of mission operation (in a MISSION_ACK message)."]
4347pub enum MavMissionResult {
4348 #[doc = "mission accepted OK"]
4349 MAV_MISSION_ACCEPTED = 0,
4350 #[doc = "Generic error / not accepting mission commands at all right now."]
4351 MAV_MISSION_ERROR = 1,
4352 #[doc = "Coordinate frame is not supported."]
4353 MAV_MISSION_UNSUPPORTED_FRAME = 2,
4354 #[doc = "Command is not supported."]
4355 MAV_MISSION_UNSUPPORTED = 3,
4356 #[doc = "Mission items exceed storage space."]
4357 MAV_MISSION_NO_SPACE = 4,
4358 #[doc = "One of the parameters has an invalid value."]
4359 MAV_MISSION_INVALID = 5,
4360 #[doc = "param1 has an invalid value."]
4361 MAV_MISSION_INVALID_PARAM1 = 6,
4362 #[doc = "param2 has an invalid value."]
4363 MAV_MISSION_INVALID_PARAM2 = 7,
4364 #[doc = "param3 has an invalid value."]
4365 MAV_MISSION_INVALID_PARAM3 = 8,
4366 #[doc = "param4 has an invalid value."]
4367 MAV_MISSION_INVALID_PARAM4 = 9,
4368 #[doc = "x / param5 has an invalid value."]
4369 MAV_MISSION_INVALID_PARAM5_X = 10,
4370 #[doc = "y / param6 has an invalid value."]
4371 MAV_MISSION_INVALID_PARAM6_Y = 11,
4372 #[doc = "z / param7 has an invalid value."]
4373 MAV_MISSION_INVALID_PARAM7 = 12,
4374 #[doc = "Mission item received out of sequence"]
4375 MAV_MISSION_INVALID_SEQUENCE = 13,
4376 #[doc = "Not accepting any mission commands from this communication partner."]
4377 MAV_MISSION_DENIED = 14,
4378 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
4379 MAV_MISSION_OPERATION_CANCELLED = 15,
4380}
4381impl MavMissionResult {
4382 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
4383}
4384impl Default for MavMissionResult {
4385 fn default() -> Self {
4386 Self::DEFAULT
4387 }
4388}
4389#[cfg_attr(feature = "ts", derive(TS))]
4390#[cfg_attr(feature = "ts", ts(export))]
4391#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4392#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4393#[cfg_attr(feature = "serde", serde(tag = "type"))]
4394#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4395#[repr(u32)]
4396#[doc = "Type of mission items being requested/sent in mission protocol."]
4397pub enum MavMissionType {
4398 #[doc = "Items are mission commands for main mission."]
4399 MAV_MISSION_TYPE_MISSION = 0,
4400 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
4401 MAV_MISSION_TYPE_FENCE = 1,
4402 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
4403 MAV_MISSION_TYPE_RALLY = 2,
4404 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
4405 MAV_MISSION_TYPE_ALL = 255,
4406}
4407impl MavMissionType {
4408 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
4409}
4410impl Default for MavMissionType {
4411 fn default() -> Self {
4412 Self::DEFAULT
4413 }
4414}
4415#[cfg_attr(feature = "ts", derive(TS))]
4416#[cfg_attr(feature = "ts", ts(export))]
4417#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4418#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4419#[cfg_attr(feature = "serde", serde(tag = "type"))]
4420#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4421#[repr(u32)]
4422#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
4423pub enum MavMode {
4424 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
4425 MAV_MODE_PREFLIGHT = 0,
4426 #[doc = "System is allowed to be active, under assisted RC control."]
4427 MAV_MODE_STABILIZE_DISARMED = 80,
4428 #[doc = "System is allowed to be active, under assisted RC control."]
4429 MAV_MODE_STABILIZE_ARMED = 208,
4430 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
4431 MAV_MODE_MANUAL_DISARMED = 64,
4432 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
4433 MAV_MODE_MANUAL_ARMED = 192,
4434 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
4435 MAV_MODE_GUIDED_DISARMED = 88,
4436 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
4437 MAV_MODE_GUIDED_ARMED = 216,
4438 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
4439 MAV_MODE_AUTO_DISARMED = 92,
4440 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
4441 MAV_MODE_AUTO_ARMED = 220,
4442 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
4443 MAV_MODE_TEST_DISARMED = 66,
4444 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
4445 MAV_MODE_TEST_ARMED = 194,
4446}
4447impl MavMode {
4448 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
4449}
4450impl Default for MavMode {
4451 fn default() -> Self {
4452 Self::DEFAULT
4453 }
4454}
4455bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
4456impl MavModeFlag {
4457 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
4458}
4459impl Default for MavModeFlag {
4460 fn default() -> Self {
4461 Self::DEFAULT
4462 }
4463}
4464#[cfg_attr(feature = "ts", derive(TS))]
4465#[cfg_attr(feature = "ts", ts(export))]
4466#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4467#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4468#[cfg_attr(feature = "serde", serde(tag = "type"))]
4469#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4470#[repr(u32)]
4471#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
4472pub enum MavModeFlagDecodePosition {
4473 #[doc = "First bit: 10000000"]
4474 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
4475 #[doc = "Second bit: 01000000"]
4476 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
4477 #[doc = "Third bit: 00100000"]
4478 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
4479 #[doc = "Fourth bit: 00010000"]
4480 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
4481 #[doc = "Fifth bit: 00001000"]
4482 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
4483 #[doc = "Sixth bit: 00000100"]
4484 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
4485 #[doc = "Seventh bit: 00000010"]
4486 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
4487 #[doc = "Eighth bit: 00000001"]
4488 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
4489}
4490impl MavModeFlagDecodePosition {
4491 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
4492}
4493impl Default for MavModeFlagDecodePosition {
4494 fn default() -> Self {
4495 Self::DEFAULT
4496 }
4497}
4498bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
4499impl MavModeProperty {
4500 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
4501}
4502impl Default for MavModeProperty {
4503 fn default() -> Self {
4504 Self::DEFAULT
4505 }
4506}
4507#[cfg_attr(feature = "ts", derive(TS))]
4508#[cfg_attr(feature = "ts", ts(export))]
4509#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4510#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4511#[cfg_attr(feature = "serde", serde(tag = "type"))]
4512#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4513#[repr(u32)]
4514#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
4515#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
4516pub enum MavMountMode {
4517 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
4518 MAV_MOUNT_MODE_RETRACT = 0,
4519 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
4520 MAV_MOUNT_MODE_NEUTRAL = 1,
4521 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
4522 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
4523 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
4524 MAV_MOUNT_MODE_RC_TARGETING = 3,
4525 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
4526 MAV_MOUNT_MODE_GPS_POINT = 4,
4527 #[doc = "Gimbal tracks system with specified system ID"]
4528 MAV_MOUNT_MODE_SYSID_TARGET = 5,
4529 #[doc = "Gimbal tracks home position"]
4530 MAV_MOUNT_MODE_HOME_LOCATION = 6,
4531}
4532impl MavMountMode {
4533 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
4534}
4535impl Default for MavMountMode {
4536 fn default() -> Self {
4537 Self::DEFAULT
4538 }
4539}
4540#[cfg_attr(feature = "ts", derive(TS))]
4541#[cfg_attr(feature = "ts", ts(export))]
4542#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4543#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4544#[cfg_attr(feature = "serde", serde(tag = "type"))]
4545#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4546#[repr(u32)]
4547pub enum MavOdidArmStatus {
4548 #[doc = "Passing arming checks."]
4549 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
4550 #[doc = "Generic arming failure, see error string for details."]
4551 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
4552}
4553impl MavOdidArmStatus {
4554 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
4555}
4556impl Default for MavOdidArmStatus {
4557 fn default() -> Self {
4558 Self::DEFAULT
4559 }
4560}
4561#[cfg_attr(feature = "ts", derive(TS))]
4562#[cfg_attr(feature = "ts", ts(export))]
4563#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4564#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4565#[cfg_attr(feature = "serde", serde(tag = "type"))]
4566#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4567#[repr(u32)]
4568pub enum MavOdidAuthType {
4569 #[doc = "No authentication type is specified."]
4570 MAV_ODID_AUTH_TYPE_NONE = 0,
4571 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
4572 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
4573 #[doc = "Signature for the Operator ID."]
4574 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
4575 #[doc = "Signature for the entire message set."]
4576 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
4577 #[doc = "Authentication is provided by Network Remote ID."]
4578 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
4579 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
4580 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
4581}
4582impl MavOdidAuthType {
4583 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
4584}
4585impl Default for MavOdidAuthType {
4586 fn default() -> Self {
4587 Self::DEFAULT
4588 }
4589}
4590#[cfg_attr(feature = "ts", derive(TS))]
4591#[cfg_attr(feature = "ts", ts(export))]
4592#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4593#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4594#[cfg_attr(feature = "serde", serde(tag = "type"))]
4595#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4596#[repr(u32)]
4597pub enum MavOdidCategoryEu {
4598 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
4599 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
4600 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
4601 MAV_ODID_CATEGORY_EU_OPEN = 1,
4602 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
4603 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
4604 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
4605 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
4606}
4607impl MavOdidCategoryEu {
4608 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
4609}
4610impl Default for MavOdidCategoryEu {
4611 fn default() -> Self {
4612 Self::DEFAULT
4613 }
4614}
4615#[cfg_attr(feature = "ts", derive(TS))]
4616#[cfg_attr(feature = "ts", ts(export))]
4617#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4618#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4619#[cfg_attr(feature = "serde", serde(tag = "type"))]
4620#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4621#[repr(u32)]
4622pub enum MavOdidClassEu {
4623 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
4624 MAV_ODID_CLASS_EU_UNDECLARED = 0,
4625 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
4626 MAV_ODID_CLASS_EU_CLASS_0 = 1,
4627 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
4628 MAV_ODID_CLASS_EU_CLASS_1 = 2,
4629 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
4630 MAV_ODID_CLASS_EU_CLASS_2 = 3,
4631 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
4632 MAV_ODID_CLASS_EU_CLASS_3 = 4,
4633 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
4634 MAV_ODID_CLASS_EU_CLASS_4 = 5,
4635 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
4636 MAV_ODID_CLASS_EU_CLASS_5 = 6,
4637 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
4638 MAV_ODID_CLASS_EU_CLASS_6 = 7,
4639}
4640impl MavOdidClassEu {
4641 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
4642}
4643impl Default for MavOdidClassEu {
4644 fn default() -> Self {
4645 Self::DEFAULT
4646 }
4647}
4648#[cfg_attr(feature = "ts", derive(TS))]
4649#[cfg_attr(feature = "ts", ts(export))]
4650#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4651#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4652#[cfg_attr(feature = "serde", serde(tag = "type"))]
4653#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4654#[repr(u32)]
4655pub enum MavOdidClassificationType {
4656 #[doc = "The classification type for the UA is undeclared."]
4657 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
4658 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
4659 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
4660}
4661impl MavOdidClassificationType {
4662 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
4663}
4664impl Default for MavOdidClassificationType {
4665 fn default() -> Self {
4666 Self::DEFAULT
4667 }
4668}
4669#[cfg_attr(feature = "ts", derive(TS))]
4670#[cfg_attr(feature = "ts", ts(export))]
4671#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4672#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4673#[cfg_attr(feature = "serde", serde(tag = "type"))]
4674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4675#[repr(u32)]
4676pub enum MavOdidDescType {
4677 #[doc = "Optional free-form text description of the purpose of the flight."]
4678 MAV_ODID_DESC_TYPE_TEXT = 0,
4679 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
4680 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
4681 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
4682 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
4683}
4684impl MavOdidDescType {
4685 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
4686}
4687impl Default for MavOdidDescType {
4688 fn default() -> Self {
4689 Self::DEFAULT
4690 }
4691}
4692#[cfg_attr(feature = "ts", derive(TS))]
4693#[cfg_attr(feature = "ts", ts(export))]
4694#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4695#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4696#[cfg_attr(feature = "serde", serde(tag = "type"))]
4697#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4698#[repr(u32)]
4699pub enum MavOdidHeightRef {
4700 #[doc = "The height field is relative to the take-off location."]
4701 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
4702 #[doc = "The height field is relative to ground."]
4703 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
4704}
4705impl MavOdidHeightRef {
4706 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
4707}
4708impl Default for MavOdidHeightRef {
4709 fn default() -> Self {
4710 Self::DEFAULT
4711 }
4712}
4713#[cfg_attr(feature = "ts", derive(TS))]
4714#[cfg_attr(feature = "ts", ts(export))]
4715#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4716#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4717#[cfg_attr(feature = "serde", serde(tag = "type"))]
4718#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4719#[repr(u32)]
4720pub enum MavOdidHorAcc {
4721 #[doc = "The horizontal accuracy is unknown."]
4722 MAV_ODID_HOR_ACC_UNKNOWN = 0,
4723 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
4724 MAV_ODID_HOR_ACC_10NM = 1,
4725 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
4726 MAV_ODID_HOR_ACC_4NM = 2,
4727 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
4728 MAV_ODID_HOR_ACC_2NM = 3,
4729 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
4730 MAV_ODID_HOR_ACC_1NM = 4,
4731 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
4732 MAV_ODID_HOR_ACC_0_5NM = 5,
4733 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
4734 MAV_ODID_HOR_ACC_0_3NM = 6,
4735 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
4736 MAV_ODID_HOR_ACC_0_1NM = 7,
4737 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
4738 MAV_ODID_HOR_ACC_0_05NM = 8,
4739 #[doc = "The horizontal accuracy is smaller than 30 meter."]
4740 MAV_ODID_HOR_ACC_30_METER = 9,
4741 #[doc = "The horizontal accuracy is smaller than 10 meter."]
4742 MAV_ODID_HOR_ACC_10_METER = 10,
4743 #[doc = "The horizontal accuracy is smaller than 3 meter."]
4744 MAV_ODID_HOR_ACC_3_METER = 11,
4745 #[doc = "The horizontal accuracy is smaller than 1 meter."]
4746 MAV_ODID_HOR_ACC_1_METER = 12,
4747}
4748impl MavOdidHorAcc {
4749 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
4750}
4751impl Default for MavOdidHorAcc {
4752 fn default() -> Self {
4753 Self::DEFAULT
4754 }
4755}
4756#[cfg_attr(feature = "ts", derive(TS))]
4757#[cfg_attr(feature = "ts", ts(export))]
4758#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4759#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4760#[cfg_attr(feature = "serde", serde(tag = "type"))]
4761#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4762#[repr(u32)]
4763pub enum MavOdidIdType {
4764 #[doc = "No type defined."]
4765 MAV_ODID_ID_TYPE_NONE = 0,
4766 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
4767 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
4768 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
4769 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
4770 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
4771 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
4772 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
4773 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
4774}
4775impl MavOdidIdType {
4776 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
4777}
4778impl Default for MavOdidIdType {
4779 fn default() -> Self {
4780 Self::DEFAULT
4781 }
4782}
4783#[cfg_attr(feature = "ts", derive(TS))]
4784#[cfg_attr(feature = "ts", ts(export))]
4785#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4786#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4787#[cfg_attr(feature = "serde", serde(tag = "type"))]
4788#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4789#[repr(u32)]
4790pub enum MavOdidOperatorIdType {
4791 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
4792 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
4793}
4794impl MavOdidOperatorIdType {
4795 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
4796}
4797impl Default for MavOdidOperatorIdType {
4798 fn default() -> Self {
4799 Self::DEFAULT
4800 }
4801}
4802#[cfg_attr(feature = "ts", derive(TS))]
4803#[cfg_attr(feature = "ts", ts(export))]
4804#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4805#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4806#[cfg_attr(feature = "serde", serde(tag = "type"))]
4807#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4808#[repr(u32)]
4809pub enum MavOdidOperatorLocationType {
4810 #[doc = "The location/altitude of the operator is the same as the take-off location."]
4811 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
4812 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
4813 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
4814 #[doc = "The location/altitude of the operator are fixed values."]
4815 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
4816}
4817impl MavOdidOperatorLocationType {
4818 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
4819}
4820impl Default for MavOdidOperatorLocationType {
4821 fn default() -> Self {
4822 Self::DEFAULT
4823 }
4824}
4825#[cfg_attr(feature = "ts", derive(TS))]
4826#[cfg_attr(feature = "ts", ts(export))]
4827#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4828#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4829#[cfg_attr(feature = "serde", serde(tag = "type"))]
4830#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4831#[repr(u32)]
4832pub enum MavOdidSpeedAcc {
4833 #[doc = "The speed accuracy is unknown."]
4834 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
4835 #[doc = "The speed accuracy is smaller than 10 meters per second."]
4836 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
4837 #[doc = "The speed accuracy is smaller than 3 meters per second."]
4838 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
4839 #[doc = "The speed accuracy is smaller than 1 meters per second."]
4840 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
4841 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
4842 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
4843}
4844impl MavOdidSpeedAcc {
4845 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
4846}
4847impl Default for MavOdidSpeedAcc {
4848 fn default() -> Self {
4849 Self::DEFAULT
4850 }
4851}
4852#[cfg_attr(feature = "ts", derive(TS))]
4853#[cfg_attr(feature = "ts", ts(export))]
4854#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4855#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4856#[cfg_attr(feature = "serde", serde(tag = "type"))]
4857#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4858#[repr(u32)]
4859pub enum MavOdidStatus {
4860 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
4861 MAV_ODID_STATUS_UNDECLARED = 0,
4862 #[doc = "The UA is on the ground."]
4863 MAV_ODID_STATUS_GROUND = 1,
4864 #[doc = "The UA is in the air."]
4865 MAV_ODID_STATUS_AIRBORNE = 2,
4866 #[doc = "The UA is having an emergency."]
4867 MAV_ODID_STATUS_EMERGENCY = 3,
4868 #[doc = "The remote ID system is failing or unreliable in some way."]
4869 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
4870}
4871impl MavOdidStatus {
4872 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
4873}
4874impl Default for MavOdidStatus {
4875 fn default() -> Self {
4876 Self::DEFAULT
4877 }
4878}
4879#[cfg_attr(feature = "ts", derive(TS))]
4880#[cfg_attr(feature = "ts", ts(export))]
4881#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4882#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4883#[cfg_attr(feature = "serde", serde(tag = "type"))]
4884#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4885#[repr(u32)]
4886pub enum MavOdidTimeAcc {
4887 #[doc = "The timestamp accuracy is unknown."]
4888 MAV_ODID_TIME_ACC_UNKNOWN = 0,
4889 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
4890 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
4891 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
4892 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
4893 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
4894 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
4895 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
4896 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
4897 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
4898 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
4899 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
4900 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
4901 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
4902 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
4903 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
4904 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
4905 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
4906 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
4907 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
4908 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
4909 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
4910 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
4911 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
4912 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
4913 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
4914 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
4915 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
4916 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
4917 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
4918 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
4919}
4920impl MavOdidTimeAcc {
4921 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
4922}
4923impl Default for MavOdidTimeAcc {
4924 fn default() -> Self {
4925 Self::DEFAULT
4926 }
4927}
4928#[cfg_attr(feature = "ts", derive(TS))]
4929#[cfg_attr(feature = "ts", ts(export))]
4930#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4931#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4932#[cfg_attr(feature = "serde", serde(tag = "type"))]
4933#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4934#[repr(u32)]
4935pub enum MavOdidUaType {
4936 #[doc = "No UA (Unmanned Aircraft) type defined."]
4937 MAV_ODID_UA_TYPE_NONE = 0,
4938 #[doc = "Aeroplane/Airplane. Fixed wing."]
4939 MAV_ODID_UA_TYPE_AEROPLANE = 1,
4940 #[doc = "Helicopter or multirotor."]
4941 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
4942 #[doc = "Gyroplane."]
4943 MAV_ODID_UA_TYPE_GYROPLANE = 3,
4944 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
4945 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
4946 #[doc = "Ornithopter."]
4947 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
4948 #[doc = "Glider."]
4949 MAV_ODID_UA_TYPE_GLIDER = 6,
4950 #[doc = "Kite."]
4951 MAV_ODID_UA_TYPE_KITE = 7,
4952 #[doc = "Free Balloon."]
4953 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
4954 #[doc = "Captive Balloon."]
4955 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
4956 #[doc = "Airship. E.g. a blimp."]
4957 MAV_ODID_UA_TYPE_AIRSHIP = 10,
4958 #[doc = "Free Fall/Parachute (unpowered)."]
4959 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
4960 #[doc = "Rocket."]
4961 MAV_ODID_UA_TYPE_ROCKET = 12,
4962 #[doc = "Tethered powered aircraft."]
4963 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
4964 #[doc = "Ground Obstacle."]
4965 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
4966 #[doc = "Other type of aircraft not listed earlier."]
4967 MAV_ODID_UA_TYPE_OTHER = 15,
4968}
4969impl MavOdidUaType {
4970 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
4971}
4972impl Default for MavOdidUaType {
4973 fn default() -> Self {
4974 Self::DEFAULT
4975 }
4976}
4977#[cfg_attr(feature = "ts", derive(TS))]
4978#[cfg_attr(feature = "ts", ts(export))]
4979#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4980#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4981#[cfg_attr(feature = "serde", serde(tag = "type"))]
4982#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4983#[repr(u32)]
4984pub enum MavOdidVerAcc {
4985 #[doc = "The vertical accuracy is unknown."]
4986 MAV_ODID_VER_ACC_UNKNOWN = 0,
4987 #[doc = "The vertical accuracy is smaller than 150 meter."]
4988 MAV_ODID_VER_ACC_150_METER = 1,
4989 #[doc = "The vertical accuracy is smaller than 45 meter."]
4990 MAV_ODID_VER_ACC_45_METER = 2,
4991 #[doc = "The vertical accuracy is smaller than 25 meter."]
4992 MAV_ODID_VER_ACC_25_METER = 3,
4993 #[doc = "The vertical accuracy is smaller than 10 meter."]
4994 MAV_ODID_VER_ACC_10_METER = 4,
4995 #[doc = "The vertical accuracy is smaller than 3 meter."]
4996 MAV_ODID_VER_ACC_3_METER = 5,
4997 #[doc = "The vertical accuracy is smaller than 1 meter."]
4998 MAV_ODID_VER_ACC_1_METER = 6,
4999}
5000impl MavOdidVerAcc {
5001 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
5002}
5003impl Default for MavOdidVerAcc {
5004 fn default() -> Self {
5005 Self::DEFAULT
5006 }
5007}
5008#[cfg_attr(feature = "ts", derive(TS))]
5009#[cfg_attr(feature = "ts", ts(export))]
5010#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5011#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5012#[cfg_attr(feature = "serde", serde(tag = "type"))]
5013#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5014#[repr(u32)]
5015#[doc = "Specifies the datatype of a MAVLink extended parameter."]
5016pub enum MavParamExtType {
5017 #[doc = "8-bit unsigned integer"]
5018 MAV_PARAM_EXT_TYPE_UINT8 = 1,
5019 #[doc = "8-bit signed integer"]
5020 MAV_PARAM_EXT_TYPE_INT8 = 2,
5021 #[doc = "16-bit unsigned integer"]
5022 MAV_PARAM_EXT_TYPE_UINT16 = 3,
5023 #[doc = "16-bit signed integer"]
5024 MAV_PARAM_EXT_TYPE_INT16 = 4,
5025 #[doc = "32-bit unsigned integer"]
5026 MAV_PARAM_EXT_TYPE_UINT32 = 5,
5027 #[doc = "32-bit signed integer"]
5028 MAV_PARAM_EXT_TYPE_INT32 = 6,
5029 #[doc = "64-bit unsigned integer"]
5030 MAV_PARAM_EXT_TYPE_UINT64 = 7,
5031 #[doc = "64-bit signed integer"]
5032 MAV_PARAM_EXT_TYPE_INT64 = 8,
5033 #[doc = "32-bit floating-point"]
5034 MAV_PARAM_EXT_TYPE_REAL32 = 9,
5035 #[doc = "64-bit floating-point"]
5036 MAV_PARAM_EXT_TYPE_REAL64 = 10,
5037 #[doc = "Custom Type"]
5038 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
5039}
5040impl MavParamExtType {
5041 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
5042}
5043impl Default for MavParamExtType {
5044 fn default() -> Self {
5045 Self::DEFAULT
5046 }
5047}
5048#[cfg_attr(feature = "ts", derive(TS))]
5049#[cfg_attr(feature = "ts", ts(export))]
5050#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5051#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5052#[cfg_attr(feature = "serde", serde(tag = "type"))]
5053#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5054#[repr(u32)]
5055#[doc = "Specifies the datatype of a MAVLink parameter."]
5056pub enum MavParamType {
5057 #[doc = "8-bit unsigned integer"]
5058 MAV_PARAM_TYPE_UINT8 = 1,
5059 #[doc = "8-bit signed integer"]
5060 MAV_PARAM_TYPE_INT8 = 2,
5061 #[doc = "16-bit unsigned integer"]
5062 MAV_PARAM_TYPE_UINT16 = 3,
5063 #[doc = "16-bit signed integer"]
5064 MAV_PARAM_TYPE_INT16 = 4,
5065 #[doc = "32-bit unsigned integer"]
5066 MAV_PARAM_TYPE_UINT32 = 5,
5067 #[doc = "32-bit signed integer"]
5068 MAV_PARAM_TYPE_INT32 = 6,
5069 #[doc = "64-bit unsigned integer"]
5070 MAV_PARAM_TYPE_UINT64 = 7,
5071 #[doc = "64-bit signed integer"]
5072 MAV_PARAM_TYPE_INT64 = 8,
5073 #[doc = "32-bit floating-point"]
5074 MAV_PARAM_TYPE_REAL32 = 9,
5075 #[doc = "64-bit floating-point"]
5076 MAV_PARAM_TYPE_REAL64 = 10,
5077}
5078impl MavParamType {
5079 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
5080}
5081impl Default for MavParamType {
5082 fn default() -> Self {
5083 Self::DEFAULT
5084 }
5085}
5086bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
5087impl MavPowerStatus {
5088 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
5089}
5090impl Default for MavPowerStatus {
5091 fn default() -> Self {
5092 Self::DEFAULT
5093 }
5094}
5095bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
5096impl MavProtocolCapability {
5097 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
5098}
5099impl Default for MavProtocolCapability {
5100 fn default() -> Self {
5101 Self::DEFAULT
5102 }
5103}
5104#[cfg_attr(feature = "ts", derive(TS))]
5105#[cfg_attr(feature = "ts", ts(export))]
5106#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5107#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5108#[cfg_attr(feature = "serde", serde(tag = "type"))]
5109#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5110#[repr(u32)]
5111#[doc = "Result from a MAVLink command (MAV_CMD)"]
5112pub enum MavResult {
5113 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
5114 MAV_RESULT_ACCEPTED = 0,
5115 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
5116 MAV_RESULT_TEMPORARILY_REJECTED = 1,
5117 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
5118 MAV_RESULT_DENIED = 2,
5119 #[doc = "Command is not supported (unknown)."]
5120 MAV_RESULT_UNSUPPORTED = 3,
5121 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
5122 MAV_RESULT_FAILED = 4,
5123 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
5124 MAV_RESULT_IN_PROGRESS = 5,
5125 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
5126 MAV_RESULT_CANCELLED = 6,
5127 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
5128 MAV_RESULT_COMMAND_LONG_ONLY = 7,
5129 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
5130 MAV_RESULT_COMMAND_INT_ONLY = 8,
5131 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
5132 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
5133}
5134impl MavResult {
5135 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
5136}
5137impl Default for MavResult {
5138 fn default() -> Self {
5139 Self::DEFAULT
5140 }
5141}
5142#[cfg_attr(feature = "ts", derive(TS))]
5143#[cfg_attr(feature = "ts", ts(export))]
5144#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5145#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5146#[cfg_attr(feature = "serde", serde(tag = "type"))]
5147#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5148#[repr(u32)]
5149#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
5150#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
5151pub enum MavRoi {
5152 #[doc = "No region of interest."]
5153 MAV_ROI_NONE = 0,
5154 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
5155 MAV_ROI_WPNEXT = 1,
5156 #[doc = "Point toward given waypoint."]
5157 MAV_ROI_WPINDEX = 2,
5158 #[doc = "Point toward fixed location."]
5159 MAV_ROI_LOCATION = 3,
5160 #[doc = "Point toward of given id."]
5161 MAV_ROI_TARGET = 4,
5162}
5163impl MavRoi {
5164 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
5165}
5166impl Default for MavRoi {
5167 fn default() -> Self {
5168 Self::DEFAULT
5169 }
5170}
5171#[cfg_attr(feature = "ts", derive(TS))]
5172#[cfg_attr(feature = "ts", ts(export))]
5173#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5175#[cfg_attr(feature = "serde", serde(tag = "type"))]
5176#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5177#[repr(u32)]
5178#[doc = "Enumeration of sensor orientation, according to its rotations"]
5179pub enum MavSensorOrientation {
5180 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
5181 MAV_SENSOR_ROTATION_NONE = 0,
5182 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
5183 MAV_SENSOR_ROTATION_YAW_45 = 1,
5184 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
5185 MAV_SENSOR_ROTATION_YAW_90 = 2,
5186 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
5187 MAV_SENSOR_ROTATION_YAW_135 = 3,
5188 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
5189 MAV_SENSOR_ROTATION_YAW_180 = 4,
5190 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
5191 MAV_SENSOR_ROTATION_YAW_225 = 5,
5192 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
5193 MAV_SENSOR_ROTATION_YAW_270 = 6,
5194 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
5195 MAV_SENSOR_ROTATION_YAW_315 = 7,
5196 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
5197 MAV_SENSOR_ROTATION_ROLL_180 = 8,
5198 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
5199 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
5200 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
5201 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
5202 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
5203 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
5204 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
5205 MAV_SENSOR_ROTATION_PITCH_180 = 12,
5206 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
5207 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
5208 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
5209 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
5210 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
5211 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
5212 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
5213 MAV_SENSOR_ROTATION_ROLL_90 = 16,
5214 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
5215 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
5216 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
5217 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
5218 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
5219 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
5220 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
5221 MAV_SENSOR_ROTATION_ROLL_270 = 20,
5222 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
5223 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
5224 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
5225 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
5226 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
5227 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
5228 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
5229 MAV_SENSOR_ROTATION_PITCH_90 = 24,
5230 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
5231 MAV_SENSOR_ROTATION_PITCH_270 = 25,
5232 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
5233 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
5234 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
5235 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
5236 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
5237 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
5238 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
5239 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
5240 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
5241 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
5242 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
5243 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
5244 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
5245 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
5246 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
5247 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
5248 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
5249 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
5250 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
5251 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
5252 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
5253 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
5254 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
5255 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
5256 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
5257 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
5258 #[doc = "Pitch: 315"]
5259 MAV_SENSOR_ROTATION_PITCH_315 = 39,
5260 #[doc = "Roll: 90, Pitch: 315"]
5261 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
5262 #[doc = "Custom orientation"]
5263 MAV_SENSOR_ROTATION_CUSTOM = 100,
5264}
5265impl MavSensorOrientation {
5266 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
5267}
5268impl Default for MavSensorOrientation {
5269 fn default() -> Self {
5270 Self::DEFAULT
5271 }
5272}
5273#[cfg_attr(feature = "ts", derive(TS))]
5274#[cfg_attr(feature = "ts", ts(export))]
5275#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5276#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5277#[cfg_attr(feature = "serde", serde(tag = "type"))]
5278#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5279#[repr(u32)]
5280#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
5281pub enum MavSeverity {
5282 #[doc = "System is unusable. This is a \"panic\" condition."]
5283 MAV_SEVERITY_EMERGENCY = 0,
5284 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
5285 MAV_SEVERITY_ALERT = 1,
5286 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
5287 MAV_SEVERITY_CRITICAL = 2,
5288 #[doc = "Indicates an error in secondary/redundant systems."]
5289 MAV_SEVERITY_ERROR = 3,
5290 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
5291 MAV_SEVERITY_WARNING = 4,
5292 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
5293 MAV_SEVERITY_NOTICE = 5,
5294 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
5295 MAV_SEVERITY_INFO = 6,
5296 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
5297 MAV_SEVERITY_DEBUG = 7,
5298}
5299impl MavSeverity {
5300 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
5301}
5302impl Default for MavSeverity {
5303 fn default() -> Self {
5304 Self::DEFAULT
5305 }
5306}
5307#[cfg_attr(feature = "ts", derive(TS))]
5308#[cfg_attr(feature = "ts", ts(export))]
5309#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5310#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5311#[cfg_attr(feature = "serde", serde(tag = "type"))]
5312#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5313#[repr(u32)]
5314#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
5315pub enum MavStandardMode {
5316 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
5317 MAV_STANDARD_MODE_NON_STANDARD = 0,
5318 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
5319 MAV_STANDARD_MODE_POSITION_HOLD = 1,
5320 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
5321 MAV_STANDARD_MODE_ORBIT = 2,
5322 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
5323 MAV_STANDARD_MODE_CRUISE = 3,
5324 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
5325 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
5326 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
5327 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
5328 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
5329 MAV_STANDARD_MODE_MISSION = 6,
5330 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
5331 MAV_STANDARD_MODE_LAND = 7,
5332 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
5333 MAV_STANDARD_MODE_TAKEOFF = 8,
5334}
5335impl MavStandardMode {
5336 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
5337}
5338impl Default for MavStandardMode {
5339 fn default() -> Self {
5340 Self::DEFAULT
5341 }
5342}
5343#[cfg_attr(feature = "ts", derive(TS))]
5344#[cfg_attr(feature = "ts", ts(export))]
5345#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5346#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5347#[cfg_attr(feature = "serde", serde(tag = "type"))]
5348#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5349#[repr(u32)]
5350pub enum MavState {
5351 #[doc = "Uninitialized system, state is unknown."]
5352 MAV_STATE_UNINIT = 0,
5353 #[doc = "System is booting up."]
5354 MAV_STATE_BOOT = 1,
5355 #[doc = "System is calibrating and not flight-ready."]
5356 MAV_STATE_CALIBRATING = 2,
5357 #[doc = "System is grounded and on standby. It can be launched any time."]
5358 MAV_STATE_STANDBY = 3,
5359 #[doc = "System is active and might be already airborne. Motors are engaged."]
5360 MAV_STATE_ACTIVE = 4,
5361 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
5362 MAV_STATE_CRITICAL = 5,
5363 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
5364 MAV_STATE_EMERGENCY = 6,
5365 #[doc = "System just initialized its power-down sequence, will shut down now."]
5366 MAV_STATE_POWEROFF = 7,
5367 #[doc = "System is terminating itself (failsafe or commanded)."]
5368 MAV_STATE_FLIGHT_TERMINATION = 8,
5369}
5370impl MavState {
5371 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
5372}
5373impl Default for MavState {
5374 fn default() -> Self {
5375 Self::DEFAULT
5376 }
5377}
5378bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
5379impl MavSysStatusSensor {
5380 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
5381}
5382impl Default for MavSysStatusSensor {
5383 fn default() -> Self {
5384 Self::DEFAULT
5385 }
5386}
5387bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
5388impl MavSysStatusSensorExtended {
5389 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
5390}
5391impl Default for MavSysStatusSensorExtended {
5392 fn default() -> Self {
5393 Self::DEFAULT
5394 }
5395}
5396#[cfg_attr(feature = "ts", derive(TS))]
5397#[cfg_attr(feature = "ts", ts(export))]
5398#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5399#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5400#[cfg_attr(feature = "serde", serde(tag = "type"))]
5401#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5402#[repr(u32)]
5403pub enum MavTunnelPayloadType {
5404 #[doc = "Encoding of payload unknown."]
5405 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
5406 #[doc = "Registered for STorM32 gimbal controller."]
5407 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
5408 #[doc = "Registered for STorM32 gimbal controller."]
5409 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
5410 #[doc = "Registered for STorM32 gimbal controller."]
5411 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
5412 #[doc = "Registered for STorM32 gimbal controller."]
5413 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
5414 #[doc = "Registered for STorM32 gimbal controller."]
5415 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
5416 #[doc = "Registered for STorM32 gimbal controller."]
5417 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
5418 #[doc = "Registered for STorM32 gimbal controller."]
5419 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
5420 #[doc = "Registered for STorM32 gimbal controller."]
5421 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
5422 #[doc = "Registered for STorM32 gimbal controller."]
5423 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
5424 #[doc = "Registered for STorM32 gimbal controller."]
5425 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
5426 #[doc = "Registered for ModalAI remote OSD protocol."]
5427 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
5428 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
5429 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
5430 #[doc = "Registered for ModalAI vendor use."]
5431 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
5432}
5433impl MavTunnelPayloadType {
5434 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
5435}
5436impl Default for MavTunnelPayloadType {
5437 fn default() -> Self {
5438 Self::DEFAULT
5439 }
5440}
5441#[cfg_attr(feature = "ts", derive(TS))]
5442#[cfg_attr(feature = "ts", ts(export))]
5443#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5444#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5445#[cfg_attr(feature = "serde", serde(tag = "type"))]
5446#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5447#[repr(u32)]
5448#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
5449pub enum MavType {
5450 #[doc = "Generic micro air vehicle"]
5451 MAV_TYPE_GENERIC = 0,
5452 #[doc = "Fixed wing aircraft."]
5453 MAV_TYPE_FIXED_WING = 1,
5454 #[doc = "Quadrotor"]
5455 MAV_TYPE_QUADROTOR = 2,
5456 #[doc = "Coaxial helicopter"]
5457 MAV_TYPE_COAXIAL = 3,
5458 #[doc = "Normal helicopter with tail rotor."]
5459 MAV_TYPE_HELICOPTER = 4,
5460 #[doc = "Ground installation"]
5461 MAV_TYPE_ANTENNA_TRACKER = 5,
5462 #[doc = "Operator control unit / ground control station"]
5463 MAV_TYPE_GCS = 6,
5464 #[doc = "Airship, controlled"]
5465 MAV_TYPE_AIRSHIP = 7,
5466 #[doc = "Free balloon, uncontrolled"]
5467 MAV_TYPE_FREE_BALLOON = 8,
5468 #[doc = "Rocket"]
5469 MAV_TYPE_ROCKET = 9,
5470 #[doc = "Ground rover"]
5471 MAV_TYPE_GROUND_ROVER = 10,
5472 #[doc = "Surface vessel, boat, ship"]
5473 MAV_TYPE_SURFACE_BOAT = 11,
5474 #[doc = "Submarine"]
5475 MAV_TYPE_SUBMARINE = 12,
5476 #[doc = "Hexarotor"]
5477 MAV_TYPE_HEXAROTOR = 13,
5478 #[doc = "Octorotor"]
5479 MAV_TYPE_OCTOROTOR = 14,
5480 #[doc = "Tricopter"]
5481 MAV_TYPE_TRICOPTER = 15,
5482 #[doc = "Flapping wing"]
5483 MAV_TYPE_FLAPPING_WING = 16,
5484 #[doc = "Kite"]
5485 MAV_TYPE_KITE = 17,
5486 #[doc = "Onboard companion controller"]
5487 MAV_TYPE_ONBOARD_CONTROLLER = 18,
5488 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
5489 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
5490 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
5491 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
5492 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
5493 MAV_TYPE_VTOL_TILTROTOR = 21,
5494 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
5495 MAV_TYPE_VTOL_FIXEDROTOR = 22,
5496 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
5497 MAV_TYPE_VTOL_TAILSITTER = 23,
5498 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
5499 MAV_TYPE_VTOL_TILTWING = 24,
5500 #[doc = "VTOL reserved 5"]
5501 MAV_TYPE_VTOL_RESERVED5 = 25,
5502 #[doc = "Gimbal"]
5503 MAV_TYPE_GIMBAL = 26,
5504 #[doc = "ADSB system"]
5505 MAV_TYPE_ADSB = 27,
5506 #[doc = "Steerable, nonrigid airfoil"]
5507 MAV_TYPE_PARAFOIL = 28,
5508 #[doc = "Dodecarotor"]
5509 MAV_TYPE_DODECAROTOR = 29,
5510 #[doc = "Camera"]
5511 MAV_TYPE_CAMERA = 30,
5512 #[doc = "Charging station"]
5513 MAV_TYPE_CHARGING_STATION = 31,
5514 #[doc = "FLARM collision avoidance system"]
5515 MAV_TYPE_FLARM = 32,
5516 #[doc = "Servo"]
5517 MAV_TYPE_SERVO = 33,
5518 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
5519 MAV_TYPE_ODID = 34,
5520 #[doc = "Decarotor"]
5521 MAV_TYPE_DECAROTOR = 35,
5522 #[doc = "Battery"]
5523 MAV_TYPE_BATTERY = 36,
5524 #[doc = "Parachute"]
5525 MAV_TYPE_PARACHUTE = 37,
5526 #[doc = "Log"]
5527 MAV_TYPE_LOG = 38,
5528 #[doc = "OSD"]
5529 MAV_TYPE_OSD = 39,
5530 #[doc = "IMU"]
5531 MAV_TYPE_IMU = 40,
5532 #[doc = "GPS"]
5533 MAV_TYPE_GPS = 41,
5534 #[doc = "Winch"]
5535 MAV_TYPE_WINCH = 42,
5536 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
5537 MAV_TYPE_GENERIC_MULTIROTOR = 43,
5538 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
5539 MAV_TYPE_ILLUMINATOR = 44,
5540 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
5541 MAV_TYPE_SPACECRAFT_ORBITER = 45,
5542}
5543impl MavType {
5544 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
5545}
5546impl Default for MavType {
5547 fn default() -> Self {
5548 Self::DEFAULT
5549 }
5550}
5551#[cfg_attr(feature = "ts", derive(TS))]
5552#[cfg_attr(feature = "ts", ts(export))]
5553#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5554#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5555#[cfg_attr(feature = "serde", serde(tag = "type"))]
5556#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5557#[repr(u32)]
5558#[doc = "Enumeration of VTOL states"]
5559pub enum MavVtolState {
5560 #[doc = "MAV is not configured as VTOL"]
5561 MAV_VTOL_STATE_UNDEFINED = 0,
5562 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
5563 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
5564 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
5565 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
5566 #[doc = "VTOL is in multicopter state"]
5567 MAV_VTOL_STATE_MC = 3,
5568 #[doc = "VTOL is in fixed-wing state"]
5569 MAV_VTOL_STATE_FW = 4,
5570}
5571impl MavVtolState {
5572 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
5573}
5574impl Default for MavVtolState {
5575 fn default() -> Self {
5576 Self::DEFAULT
5577 }
5578}
5579bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
5580impl MavWinchStatusFlag {
5581 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
5582}
5583impl Default for MavWinchStatusFlag {
5584 fn default() -> Self {
5585 Self::DEFAULT
5586 }
5587}
5588#[cfg_attr(feature = "ts", derive(TS))]
5589#[cfg_attr(feature = "ts", ts(export))]
5590#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5591#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5592#[cfg_attr(feature = "serde", serde(tag = "type"))]
5593#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5594#[repr(u32)]
5595pub enum MavlinkDataStreamType {
5596 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
5597 MAVLINK_DATA_STREAM_IMG_BMP = 1,
5598 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
5599 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
5600 MAVLINK_DATA_STREAM_IMG_PGM = 4,
5601 MAVLINK_DATA_STREAM_IMG_PNG = 5,
5602}
5603impl MavlinkDataStreamType {
5604 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
5605}
5606impl Default for MavlinkDataStreamType {
5607 fn default() -> Self {
5608 Self::DEFAULT
5609 }
5610}
5611#[cfg_attr(feature = "ts", derive(TS))]
5612#[cfg_attr(feature = "ts", ts(export))]
5613#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5614#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5615#[cfg_attr(feature = "serde", serde(tag = "type"))]
5616#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5617#[repr(u32)]
5618#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
5619pub enum MissionState {
5620 #[doc = "The mission status reporting is not supported."]
5621 MISSION_STATE_UNKNOWN = 0,
5622 #[doc = "No mission on the vehicle."]
5623 MISSION_STATE_NO_MISSION = 1,
5624 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
5625 MISSION_STATE_NOT_STARTED = 2,
5626 #[doc = "Mission is active, and will execute mission items when in auto mode."]
5627 MISSION_STATE_ACTIVE = 3,
5628 #[doc = "Mission is paused when in auto mode."]
5629 MISSION_STATE_PAUSED = 4,
5630 #[doc = "Mission has executed all mission items."]
5631 MISSION_STATE_COMPLETE = 5,
5632}
5633impl MissionState {
5634 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
5635}
5636impl Default for MissionState {
5637 fn default() -> Self {
5638 Self::DEFAULT
5639 }
5640}
5641#[cfg_attr(feature = "ts", derive(TS))]
5642#[cfg_attr(feature = "ts", ts(export))]
5643#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5644#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5645#[cfg_attr(feature = "serde", serde(tag = "type"))]
5646#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5647#[repr(u32)]
5648#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
5649pub enum MotorTestOrder {
5650 #[doc = "Default autopilot motor test method."]
5651 MOTOR_TEST_ORDER_DEFAULT = 0,
5652 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
5653 MOTOR_TEST_ORDER_SEQUENCE = 1,
5654 #[doc = "Motor numbers are specified as the output as labeled on the board."]
5655 MOTOR_TEST_ORDER_BOARD = 2,
5656}
5657impl MotorTestOrder {
5658 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
5659}
5660impl Default for MotorTestOrder {
5661 fn default() -> Self {
5662 Self::DEFAULT
5663 }
5664}
5665#[cfg_attr(feature = "ts", derive(TS))]
5666#[cfg_attr(feature = "ts", ts(export))]
5667#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5668#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5669#[cfg_attr(feature = "serde", serde(tag = "type"))]
5670#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5671#[repr(u32)]
5672#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
5673pub enum MotorTestThrottleType {
5674 #[doc = "Throttle as a percentage (0 ~ 100)"]
5675 MOTOR_TEST_THROTTLE_PERCENT = 0,
5676 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
5677 MOTOR_TEST_THROTTLE_PWM = 1,
5678 #[doc = "Throttle pass-through from pilot's transmitter."]
5679 MOTOR_TEST_THROTTLE_PILOT = 2,
5680 #[doc = "Per-motor compass calibration test."]
5681 MOTOR_TEST_COMPASS_CAL = 3,
5682}
5683impl MotorTestThrottleType {
5684 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
5685}
5686impl Default for MotorTestThrottleType {
5687 fn default() -> Self {
5688 Self::DEFAULT
5689 }
5690}
5691#[cfg_attr(feature = "ts", derive(TS))]
5692#[cfg_attr(feature = "ts", ts(export))]
5693#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5694#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5695#[cfg_attr(feature = "serde", serde(tag = "type"))]
5696#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5697#[repr(u32)]
5698pub enum NavVtolLandOptions {
5699 #[doc = "Default autopilot landing behaviour."]
5700 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
5701 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
5702 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
5703 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
5704 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
5705}
5706impl NavVtolLandOptions {
5707 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
5708}
5709impl Default for NavVtolLandOptions {
5710 fn default() -> Self {
5711 Self::DEFAULT
5712 }
5713}
5714#[cfg_attr(feature = "ts", derive(TS))]
5715#[cfg_attr(feature = "ts", ts(export))]
5716#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5717#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5718#[cfg_attr(feature = "serde", serde(tag = "type"))]
5719#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5720#[repr(u32)]
5721#[doc = "Yaw behaviour during orbit flight."]
5722pub enum OrbitYawBehaviour {
5723 #[doc = "Vehicle front points to the center (default)."]
5724 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
5725 #[doc = "Vehicle front holds heading when message received."]
5726 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
5727 #[doc = "Yaw uncontrolled."]
5728 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
5729 #[doc = "Vehicle front follows flight path (tangential to circle)."]
5730 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
5731 #[doc = "Yaw controlled by RC input."]
5732 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
5733 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
5734 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
5735}
5736impl OrbitYawBehaviour {
5737 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
5738}
5739impl Default for OrbitYawBehaviour {
5740 fn default() -> Self {
5741 Self::DEFAULT
5742 }
5743}
5744#[cfg_attr(feature = "ts", derive(TS))]
5745#[cfg_attr(feature = "ts", ts(export))]
5746#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5747#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5748#[cfg_attr(feature = "serde", serde(tag = "type"))]
5749#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5750#[repr(u32)]
5751#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
5752pub enum ParachuteAction {
5753 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
5754 PARACHUTE_DISABLE = 0,
5755 #[doc = "Enable auto-release of parachute."]
5756 PARACHUTE_ENABLE = 1,
5757 #[doc = "Release parachute and kill motors."]
5758 PARACHUTE_RELEASE = 2,
5759}
5760impl ParachuteAction {
5761 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
5762}
5763impl Default for ParachuteAction {
5764 fn default() -> Self {
5765 Self::DEFAULT
5766 }
5767}
5768#[cfg_attr(feature = "ts", derive(TS))]
5769#[cfg_attr(feature = "ts", ts(export))]
5770#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5771#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5772#[cfg_attr(feature = "serde", serde(tag = "type"))]
5773#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5774#[repr(u32)]
5775#[doc = "Result from PARAM_EXT_SET message."]
5776pub enum ParamAck {
5777 #[doc = "Parameter value ACCEPTED and SET"]
5778 PARAM_ACK_ACCEPTED = 0,
5779 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
5780 PARAM_ACK_VALUE_UNSUPPORTED = 1,
5781 #[doc = "Parameter failed to set"]
5782 PARAM_ACK_FAILED = 2,
5783 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
5784 PARAM_ACK_IN_PROGRESS = 3,
5785}
5786impl ParamAck {
5787 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
5788}
5789impl Default for ParamAck {
5790 fn default() -> Self {
5791 Self::DEFAULT
5792 }
5793}
5794bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
5795impl PositionTargetTypemask {
5796 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
5797}
5798impl Default for PositionTargetTypemask {
5799 fn default() -> Self {
5800 Self::DEFAULT
5801 }
5802}
5803#[cfg_attr(feature = "ts", derive(TS))]
5804#[cfg_attr(feature = "ts", ts(export))]
5805#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5806#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5807#[cfg_attr(feature = "serde", serde(tag = "type"))]
5808#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5809#[repr(u32)]
5810#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
5811pub enum PrecisionLandMode {
5812 #[doc = "Normal (non-precision) landing."]
5813 PRECISION_LAND_MODE_DISABLED = 0,
5814 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
5815 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
5816 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
5817 PRECISION_LAND_MODE_REQUIRED = 2,
5818}
5819impl PrecisionLandMode {
5820 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
5821}
5822impl Default for PrecisionLandMode {
5823 fn default() -> Self {
5824 Self::DEFAULT
5825 }
5826}
5827#[cfg_attr(feature = "ts", derive(TS))]
5828#[cfg_attr(feature = "ts", ts(export))]
5829#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5830#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5831#[cfg_attr(feature = "serde", serde(tag = "type"))]
5832#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5833#[repr(u32)]
5834#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
5835pub enum PreflightStorageMissionAction {
5836 #[doc = "Read current mission data from persistent storage"]
5837 MISSION_READ_PERSISTENT = 0,
5838 #[doc = "Write current mission data to persistent storage"]
5839 MISSION_WRITE_PERSISTENT = 1,
5840 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
5841 MISSION_RESET_DEFAULT = 2,
5842}
5843impl PreflightStorageMissionAction {
5844 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
5845}
5846impl Default for PreflightStorageMissionAction {
5847 fn default() -> Self {
5848 Self::DEFAULT
5849 }
5850}
5851#[cfg_attr(feature = "ts", derive(TS))]
5852#[cfg_attr(feature = "ts", ts(export))]
5853#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5854#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5855#[cfg_attr(feature = "serde", serde(tag = "type"))]
5856#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5857#[repr(u32)]
5858#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
5859pub enum PreflightStorageParameterAction {
5860 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
5861 PARAM_READ_PERSISTENT = 0,
5862 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
5863 PARAM_WRITE_PERSISTENT = 1,
5864 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
5865 PARAM_RESET_CONFIG_DEFAULT = 2,
5866 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
5867 PARAM_RESET_SENSOR_DEFAULT = 3,
5868 #[doc = "Reset all parameters, including operation counters, to default values"]
5869 PARAM_RESET_ALL_DEFAULT = 4,
5870}
5871impl PreflightStorageParameterAction {
5872 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
5873}
5874impl Default for PreflightStorageParameterAction {
5875 fn default() -> Self {
5876 Self::DEFAULT
5877 }
5878}
5879#[cfg_attr(feature = "ts", derive(TS))]
5880#[cfg_attr(feature = "ts", ts(export))]
5881#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5882#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5883#[cfg_attr(feature = "serde", serde(tag = "type"))]
5884#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5885#[repr(u32)]
5886#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
5887pub enum RcSubType {
5888 #[doc = "Spektrum DSM2"]
5889 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
5890 #[doc = "Spektrum DSMX"]
5891 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
5892 #[doc = "Spektrum DSMX8"]
5893 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
5894}
5895impl RcSubType {
5896 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
5897}
5898impl Default for RcSubType {
5899 fn default() -> Self {
5900 Self::DEFAULT
5901 }
5902}
5903#[cfg_attr(feature = "ts", derive(TS))]
5904#[cfg_attr(feature = "ts", ts(export))]
5905#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5906#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5907#[cfg_attr(feature = "serde", serde(tag = "type"))]
5908#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5909#[repr(u32)]
5910#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
5911pub enum RcType {
5912 #[doc = "Spektrum"]
5913 RC_TYPE_SPEKTRUM = 0,
5914 #[doc = "CRSF"]
5915 RC_TYPE_CRSF = 1,
5916}
5917impl RcType {
5918 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
5919}
5920impl Default for RcType {
5921 fn default() -> Self {
5922 Self::DEFAULT
5923 }
5924}
5925#[cfg_attr(feature = "ts", derive(TS))]
5926#[cfg_attr(feature = "ts", ts(export))]
5927#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5928#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5929#[cfg_attr(feature = "serde", serde(tag = "type"))]
5930#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5931#[repr(u32)]
5932#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
5933pub enum RebootShutdownConditions {
5934 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
5935 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
5936 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
5937 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
5938}
5939impl RebootShutdownConditions {
5940 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
5941}
5942impl Default for RebootShutdownConditions {
5943 fn default() -> Self {
5944 Self::DEFAULT
5945 }
5946}
5947#[cfg_attr(feature = "ts", derive(TS))]
5948#[cfg_attr(feature = "ts", ts(export))]
5949#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5951#[cfg_attr(feature = "serde", serde(tag = "type"))]
5952#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5953#[repr(u32)]
5954#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
5955pub enum RtkBaselineCoordinateSystem {
5956 #[doc = "Earth-centered, Earth-fixed"]
5957 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
5958 #[doc = "RTK basestation centered, north, east, down"]
5959 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
5960}
5961impl RtkBaselineCoordinateSystem {
5962 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
5963}
5964impl Default for RtkBaselineCoordinateSystem {
5965 fn default() -> Self {
5966 Self::DEFAULT
5967 }
5968}
5969#[cfg_attr(feature = "ts", derive(TS))]
5970#[cfg_attr(feature = "ts", ts(export))]
5971#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5972#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5973#[cfg_attr(feature = "serde", serde(tag = "type"))]
5974#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5975#[repr(u32)]
5976#[doc = "Possible safety switch states."]
5977pub enum SafetySwitchState {
5978 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
5979 SAFETY_SWITCH_STATE_SAFE = 0,
5980 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
5981 SAFETY_SWITCH_STATE_DANGEROUS = 1,
5982}
5983impl SafetySwitchState {
5984 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
5985}
5986impl Default for SafetySwitchState {
5987 fn default() -> Self {
5988 Self::DEFAULT
5989 }
5990}
5991#[cfg_attr(feature = "ts", derive(TS))]
5992#[cfg_attr(feature = "ts", ts(export))]
5993#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5994#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5995#[cfg_attr(feature = "serde", serde(tag = "type"))]
5996#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5997#[repr(u32)]
5998#[doc = "SERIAL_CONTROL device types"]
5999pub enum SerialControlDev {
6000 #[doc = "First telemetry port"]
6001 SERIAL_CONTROL_DEV_TELEM1 = 0,
6002 #[doc = "Second telemetry port"]
6003 SERIAL_CONTROL_DEV_TELEM2 = 1,
6004 #[doc = "First GPS port"]
6005 SERIAL_CONTROL_DEV_GPS1 = 2,
6006 #[doc = "Second GPS port"]
6007 SERIAL_CONTROL_DEV_GPS2 = 3,
6008 #[doc = "system shell"]
6009 SERIAL_CONTROL_DEV_SHELL = 10,
6010 #[doc = "SERIAL0"]
6011 SERIAL_CONTROL_SERIAL0 = 100,
6012 #[doc = "SERIAL1"]
6013 SERIAL_CONTROL_SERIAL1 = 101,
6014 #[doc = "SERIAL2"]
6015 SERIAL_CONTROL_SERIAL2 = 102,
6016 #[doc = "SERIAL3"]
6017 SERIAL_CONTROL_SERIAL3 = 103,
6018 #[doc = "SERIAL4"]
6019 SERIAL_CONTROL_SERIAL4 = 104,
6020 #[doc = "SERIAL5"]
6021 SERIAL_CONTROL_SERIAL5 = 105,
6022 #[doc = "SERIAL6"]
6023 SERIAL_CONTROL_SERIAL6 = 106,
6024 #[doc = "SERIAL7"]
6025 SERIAL_CONTROL_SERIAL7 = 107,
6026 #[doc = "SERIAL8"]
6027 SERIAL_CONTROL_SERIAL8 = 108,
6028 #[doc = "SERIAL9"]
6029 SERIAL_CONTROL_SERIAL9 = 109,
6030}
6031impl SerialControlDev {
6032 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
6033}
6034impl Default for SerialControlDev {
6035 fn default() -> Self {
6036 Self::DEFAULT
6037 }
6038}
6039bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
6040impl SerialControlFlag {
6041 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
6042}
6043impl Default for SerialControlFlag {
6044 fn default() -> Self {
6045 Self::DEFAULT
6046 }
6047}
6048#[cfg_attr(feature = "ts", derive(TS))]
6049#[cfg_attr(feature = "ts", ts(export))]
6050#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
6051#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6052#[cfg_attr(feature = "serde", serde(tag = "type"))]
6053#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6054#[repr(u32)]
6055#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
6056pub enum SetFocusType {
6057 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
6058 FOCUS_TYPE_STEP = 0,
6059 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
6060 FOCUS_TYPE_CONTINUOUS = 1,
6061 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
6062 FOCUS_TYPE_RANGE = 2,
6063 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
6064 FOCUS_TYPE_METERS = 3,
6065 #[doc = "Focus automatically."]
6066 FOCUS_TYPE_AUTO = 4,
6067 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
6068 FOCUS_TYPE_AUTO_SINGLE = 5,
6069 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
6070 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
6071}
6072impl SetFocusType {
6073 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
6074}
6075impl Default for SetFocusType {
6076 fn default() -> Self {
6077 Self::DEFAULT
6078 }
6079}
6080#[cfg_attr(feature = "ts", derive(TS))]
6081#[cfg_attr(feature = "ts", ts(export))]
6082#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
6083#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6084#[cfg_attr(feature = "serde", serde(tag = "type"))]
6085#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6086#[repr(u32)]
6087#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
6088pub enum SpeedType {
6089 #[doc = "Airspeed"]
6090 SPEED_TYPE_AIRSPEED = 0,
6091 #[doc = "Groundspeed"]
6092 SPEED_TYPE_GROUNDSPEED = 1,
6093 #[doc = "Climb speed"]
6094 SPEED_TYPE_CLIMB_SPEED = 2,
6095 #[doc = "Descent speed"]
6096 SPEED_TYPE_DESCENT_SPEED = 3,
6097}
6098impl SpeedType {
6099 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
6100}
6101impl Default for SpeedType {
6102 fn default() -> Self {
6103 Self::DEFAULT
6104 }
6105}
6106#[cfg_attr(feature = "ts", derive(TS))]
6107#[cfg_attr(feature = "ts", ts(export))]
6108#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
6109#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6110#[cfg_attr(feature = "serde", serde(tag = "type"))]
6111#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6112#[repr(u32)]
6113#[doc = "Flags to indicate the status of camera storage."]
6114pub enum StorageStatus {
6115 #[doc = "Storage is missing (no microSD card loaded for example.)"]
6116 STORAGE_STATUS_EMPTY = 0,
6117 #[doc = "Storage present but unformatted."]
6118 STORAGE_STATUS_UNFORMATTED = 1,
6119 #[doc = "Storage present and ready."]
6120 STORAGE_STATUS_READY = 2,
6121 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
6122 STORAGE_STATUS_NOT_SUPPORTED = 3,
6123}
6124impl StorageStatus {
6125 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
6126}
6127impl Default for StorageStatus {
6128 fn default() -> Self {
6129 Self::DEFAULT
6130 }
6131}
6132#[cfg_attr(feature = "ts", derive(TS))]
6133#[cfg_attr(feature = "ts", ts(export))]
6134#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
6135#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6136#[cfg_attr(feature = "serde", serde(tag = "type"))]
6137#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6138#[repr(u32)]
6139#[doc = "Flags to indicate the type of storage."]
6140pub enum StorageType {
6141 #[doc = "Storage type is not known."]
6142 STORAGE_TYPE_UNKNOWN = 0,
6143 #[doc = "Storage type is USB device."]
6144 STORAGE_TYPE_USB_STICK = 1,
6145 #[doc = "Storage type is SD card."]
6146 STORAGE_TYPE_SD = 2,
6147 #[doc = "Storage type is microSD card."]
6148 STORAGE_TYPE_MICROSD = 3,
6149 #[doc = "Storage type is CFast."]
6150 STORAGE_TYPE_CF = 4,
6151 #[doc = "Storage type is CFexpress."]
6152 STORAGE_TYPE_CFE = 5,
6153 #[doc = "Storage type is XQD."]
6154 STORAGE_TYPE_XQD = 6,
6155 #[doc = "Storage type is HD mass storage type."]
6156 STORAGE_TYPE_HD = 7,
6157 #[doc = "Storage type is other, not listed type."]
6158 STORAGE_TYPE_OTHER = 254,
6159}
6160impl StorageType {
6161 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
6162}
6163impl Default for StorageType {
6164 fn default() -> Self {
6165 Self::DEFAULT
6166 }
6167}
6168bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
6169impl StorageUsageFlag {
6170 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
6171}
6172impl Default for StorageUsageFlag {
6173 fn default() -> Self {
6174 Self::DEFAULT
6175 }
6176}
6177#[cfg_attr(feature = "ts", derive(TS))]
6178#[cfg_attr(feature = "ts", ts(export))]
6179#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
6180#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6181#[cfg_attr(feature = "serde", serde(tag = "type"))]
6182#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6183#[repr(u32)]
6184#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
6185pub enum TuneFormat {
6186 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
6187 TUNE_FORMAT_QBASIC1_1 = 1,
6188 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
6189 TUNE_FORMAT_MML_MODERN = 2,
6190}
6191impl TuneFormat {
6192 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
6193}
6194impl Default for TuneFormat {
6195 fn default() -> Self {
6196 Self::DEFAULT
6197 }
6198}
6199#[cfg_attr(feature = "ts", derive(TS))]
6200#[cfg_attr(feature = "ts", ts(export))]
6201#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
6202#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6203#[cfg_attr(feature = "serde", serde(tag = "type"))]
6204#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6205#[repr(u32)]
6206#[doc = "Generalized UAVCAN node health"]
6207pub enum UavcanNodeHealth {
6208 #[doc = "The node is functioning properly."]
6209 UAVCAN_NODE_HEALTH_OK = 0,
6210 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
6211 UAVCAN_NODE_HEALTH_WARNING = 1,
6212 #[doc = "The node has encountered a major failure."]
6213 UAVCAN_NODE_HEALTH_ERROR = 2,
6214 #[doc = "The node has suffered a fatal malfunction."]
6215 UAVCAN_NODE_HEALTH_CRITICAL = 3,
6216}
6217impl UavcanNodeHealth {
6218 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
6219}
6220impl Default for UavcanNodeHealth {
6221 fn default() -> Self {
6222 Self::DEFAULT
6223 }
6224}
6225#[cfg_attr(feature = "ts", derive(TS))]
6226#[cfg_attr(feature = "ts", ts(export))]
6227#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
6228#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6229#[cfg_attr(feature = "serde", serde(tag = "type"))]
6230#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6231#[repr(u32)]
6232#[doc = "Generalized UAVCAN node mode"]
6233pub enum UavcanNodeMode {
6234 #[doc = "The node is performing its primary functions."]
6235 UAVCAN_NODE_MODE_OPERATIONAL = 0,
6236 #[doc = "The node is initializing; this mode is entered immediately after startup."]
6237 UAVCAN_NODE_MODE_INITIALIZATION = 1,
6238 #[doc = "The node is under maintenance."]
6239 UAVCAN_NODE_MODE_MAINTENANCE = 2,
6240 #[doc = "The node is in the process of updating its software."]
6241 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
6242 #[doc = "The node is no longer available online."]
6243 UAVCAN_NODE_MODE_OFFLINE = 7,
6244}
6245impl UavcanNodeMode {
6246 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
6247}
6248impl Default for UavcanNodeMode {
6249 fn default() -> Self {
6250 Self::DEFAULT
6251 }
6252}
6253bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
6254impl UtmDataAvailFlags {
6255 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
6256}
6257impl Default for UtmDataAvailFlags {
6258 fn default() -> Self {
6259 Self::DEFAULT
6260 }
6261}
6262#[cfg_attr(feature = "ts", derive(TS))]
6263#[cfg_attr(feature = "ts", ts(export))]
6264#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
6265#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6266#[cfg_attr(feature = "serde", serde(tag = "type"))]
6267#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6268#[repr(u32)]
6269#[doc = "Airborne status of UAS."]
6270pub enum UtmFlightState {
6271 #[doc = "The flight state can't be determined."]
6272 UTM_FLIGHT_STATE_UNKNOWN = 1,
6273 #[doc = "UAS on ground."]
6274 UTM_FLIGHT_STATE_GROUND = 2,
6275 #[doc = "UAS airborne."]
6276 UTM_FLIGHT_STATE_AIRBORNE = 3,
6277 #[doc = "UAS is in an emergency flight state."]
6278 UTM_FLIGHT_STATE_EMERGENCY = 16,
6279 #[doc = "UAS has no active controls."]
6280 UTM_FLIGHT_STATE_NOCTRL = 32,
6281}
6282impl UtmFlightState {
6283 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
6284}
6285impl Default for UtmFlightState {
6286 fn default() -> Self {
6287 Self::DEFAULT
6288 }
6289}
6290#[cfg_attr(feature = "ts", derive(TS))]
6291#[cfg_attr(feature = "ts", ts(export))]
6292#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
6293#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6294#[cfg_attr(feature = "serde", serde(tag = "type"))]
6295#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6296#[repr(u32)]
6297#[doc = "Video stream encodings"]
6298pub enum VideoStreamEncoding {
6299 #[doc = "Stream encoding is unknown"]
6300 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
6301 #[doc = "Stream encoding is H.264"]
6302 VIDEO_STREAM_ENCODING_H264 = 1,
6303 #[doc = "Stream encoding is H.265"]
6304 VIDEO_STREAM_ENCODING_H265 = 2,
6305}
6306impl VideoStreamEncoding {
6307 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
6308}
6309impl Default for VideoStreamEncoding {
6310 fn default() -> Self {
6311 Self::DEFAULT
6312 }
6313}
6314bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
6315impl VideoStreamStatusFlags {
6316 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
6317}
6318impl Default for VideoStreamStatusFlags {
6319 fn default() -> Self {
6320 Self::DEFAULT
6321 }
6322}
6323#[cfg_attr(feature = "ts", derive(TS))]
6324#[cfg_attr(feature = "ts", ts(export))]
6325#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
6326#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6327#[cfg_attr(feature = "serde", serde(tag = "type"))]
6328#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6329#[repr(u32)]
6330#[doc = "Video stream types"]
6331pub enum VideoStreamType {
6332 #[doc = "Stream is RTSP"]
6333 VIDEO_STREAM_TYPE_RTSP = 0,
6334 #[doc = "Stream is RTP UDP (URI gives the port number)"]
6335 VIDEO_STREAM_TYPE_RTPUDP = 1,
6336 #[doc = "Stream is MPEG on TCP"]
6337 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
6338 #[doc = "Stream is MPEG TS (URI gives the port number)"]
6339 VIDEO_STREAM_TYPE_MPEG_TS = 3,
6340}
6341impl VideoStreamType {
6342 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
6343}
6344impl Default for VideoStreamType {
6345 fn default() -> Self {
6346 Self::DEFAULT
6347 }
6348}
6349#[cfg_attr(feature = "ts", derive(TS))]
6350#[cfg_attr(feature = "ts", ts(export))]
6351#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
6352#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6353#[cfg_attr(feature = "serde", serde(tag = "type"))]
6354#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6355#[repr(u32)]
6356#[doc = "Direction of VTOL transition"]
6357pub enum VtolTransitionHeading {
6358 #[doc = "Respect the heading configuration of the vehicle."]
6359 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
6360 #[doc = "Use the heading pointing towards the next waypoint."]
6361 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
6362 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
6363 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
6364 #[doc = "Use the specified heading in parameter 4."]
6365 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
6366 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
6367 VTOL_TRANSITION_HEADING_ANY = 4,
6368}
6369impl VtolTransitionHeading {
6370 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
6371}
6372impl Default for VtolTransitionHeading {
6373 fn default() -> Self {
6374 Self::DEFAULT
6375 }
6376}
6377#[cfg_attr(feature = "ts", derive(TS))]
6378#[cfg_attr(feature = "ts", ts(export))]
6379#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
6380#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6381#[cfg_attr(feature = "serde", serde(tag = "type"))]
6382#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6383#[repr(u32)]
6384#[doc = "WiFi Mode."]
6385pub enum WifiConfigApMode {
6386 #[doc = "WiFi mode is undefined."]
6387 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
6388 #[doc = "WiFi configured as an access point."]
6389 WIFI_CONFIG_AP_MODE_AP = 1,
6390 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
6391 WIFI_CONFIG_AP_MODE_STATION = 2,
6392 #[doc = "WiFi disabled."]
6393 WIFI_CONFIG_AP_MODE_DISABLED = 3,
6394}
6395impl WifiConfigApMode {
6396 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
6397}
6398impl Default for WifiConfigApMode {
6399 fn default() -> Self {
6400 Self::DEFAULT
6401 }
6402}
6403#[cfg_attr(feature = "ts", derive(TS))]
6404#[cfg_attr(feature = "ts", ts(export))]
6405#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
6406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6407#[cfg_attr(feature = "serde", serde(tag = "type"))]
6408#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6409#[repr(u32)]
6410#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
6411pub enum WifiConfigApResponse {
6412 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
6413 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
6414 #[doc = "Changes accepted."]
6415 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
6416 #[doc = "Changes rejected."]
6417 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
6418 #[doc = "Invalid Mode."]
6419 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
6420 #[doc = "Invalid SSID."]
6421 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
6422 #[doc = "Invalid Password."]
6423 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
6424}
6425impl WifiConfigApResponse {
6426 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
6427}
6428impl Default for WifiConfigApResponse {
6429 fn default() -> Self {
6430 Self::DEFAULT
6431 }
6432}
6433#[cfg_attr(feature = "ts", derive(TS))]
6434#[cfg_attr(feature = "ts", ts(export))]
6435#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
6436#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6437#[cfg_attr(feature = "serde", serde(tag = "type"))]
6438#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6439#[repr(u32)]
6440#[doc = "Winch actions."]
6441pub enum WinchActions {
6442 #[doc = "Allow motor to freewheel."]
6443 WINCH_RELAXED = 0,
6444 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
6445 WINCH_RELATIVE_LENGTH_CONTROL = 1,
6446 #[doc = "Wind or unwind line at specified rate."]
6447 WINCH_RATE_CONTROL = 2,
6448 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
6449 WINCH_LOCK = 3,
6450 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
6451 WINCH_DELIVER = 4,
6452 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
6453 WINCH_HOLD = 5,
6454 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
6455 WINCH_RETRACT = 6,
6456 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
6457 WINCH_LOAD_LINE = 7,
6458 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
6459 WINCH_ABANDON_LINE = 8,
6460 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
6461 WINCH_LOAD_PAYLOAD = 9,
6462}
6463impl WinchActions {
6464 pub const DEFAULT: Self = Self::WINCH_RELAXED;
6465}
6466impl Default for WinchActions {
6467 fn default() -> Self {
6468 Self::DEFAULT
6469 }
6470}
6471#[doc = "Set the vehicle attitude and body angular rates."]
6472#[doc = ""]
6473#[doc = "ID: 140"]
6474#[derive(Debug, Clone, PartialEq)]
6475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6476#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6477#[cfg_attr(feature = "ts", derive(TS))]
6478#[cfg_attr(feature = "ts", ts(export))]
6479pub struct ACTUATOR_CONTROL_TARGET_DATA {
6480 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
6481 pub time_usec: u64,
6482 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
6483 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6484 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6485 pub controls: [f32; 8],
6486 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
6487 pub group_mlx: u8,
6488}
6489impl ACTUATOR_CONTROL_TARGET_DATA {
6490 pub const ENCODED_LEN: usize = 41usize;
6491 pub const DEFAULT: Self = Self {
6492 time_usec: 0_u64,
6493 controls: [0.0_f32; 8usize],
6494 group_mlx: 0_u8,
6495 };
6496 #[cfg(feature = "arbitrary")]
6497 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6498 use arbitrary::{Arbitrary, Unstructured};
6499 let mut buf = [0u8; 1024];
6500 rng.fill_bytes(&mut buf);
6501 let mut unstructured = Unstructured::new(&buf);
6502 Self::arbitrary(&mut unstructured).unwrap_or_default()
6503 }
6504}
6505impl Default for ACTUATOR_CONTROL_TARGET_DATA {
6506 fn default() -> Self {
6507 Self::DEFAULT.clone()
6508 }
6509}
6510impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
6511 type Message = MavMessage;
6512 const ID: u32 = 140u32;
6513 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
6514 const EXTRA_CRC: u8 = 181u8;
6515 const ENCODED_LEN: usize = 41usize;
6516 fn deser(
6517 _version: MavlinkVersion,
6518 __input: &[u8],
6519 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6520 let avail_len = __input.len();
6521 let mut payload_buf = [0; Self::ENCODED_LEN];
6522 let mut buf = if avail_len < Self::ENCODED_LEN {
6523 payload_buf[0..avail_len].copy_from_slice(__input);
6524 Bytes::new(&payload_buf)
6525 } else {
6526 Bytes::new(__input)
6527 };
6528 let mut __struct = Self::default();
6529 __struct.time_usec = buf.get_u64_le()?;
6530 for v in &mut __struct.controls {
6531 let val = buf.get_f32_le()?;
6532 *v = val;
6533 }
6534 __struct.group_mlx = buf.get_u8()?;
6535 Ok(__struct)
6536 }
6537 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6538 let mut __tmp = BytesMut::new(bytes);
6539 #[allow(clippy::absurd_extreme_comparisons)]
6540 #[allow(unused_comparisons)]
6541 if __tmp.remaining() < Self::ENCODED_LEN {
6542 panic!(
6543 "buffer is too small (need {} bytes, but got {})",
6544 Self::ENCODED_LEN,
6545 __tmp.remaining(),
6546 )
6547 }
6548 __tmp.put_u64_le(self.time_usec);
6549 for val in &self.controls {
6550 __tmp.put_f32_le(*val);
6551 }
6552 __tmp.put_u8(self.group_mlx);
6553 if matches!(version, MavlinkVersion::V2) {
6554 let len = __tmp.len();
6555 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6556 } else {
6557 __tmp.len()
6558 }
6559 }
6560}
6561#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
6562#[doc = ""]
6563#[doc = "ID: 375"]
6564#[derive(Debug, Clone, PartialEq)]
6565#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6566#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6567#[cfg_attr(feature = "ts", derive(TS))]
6568#[cfg_attr(feature = "ts", ts(export))]
6569pub struct ACTUATOR_OUTPUT_STATUS_DATA {
6570 #[doc = "Timestamp (since system boot)."]
6571 pub time_usec: u64,
6572 #[doc = "Active outputs"]
6573 pub active: u32,
6574 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
6575 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6576 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6577 pub actuator: [f32; 32],
6578}
6579impl ACTUATOR_OUTPUT_STATUS_DATA {
6580 pub const ENCODED_LEN: usize = 140usize;
6581 pub const DEFAULT: Self = Self {
6582 time_usec: 0_u64,
6583 active: 0_u32,
6584 actuator: [0.0_f32; 32usize],
6585 };
6586 #[cfg(feature = "arbitrary")]
6587 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6588 use arbitrary::{Arbitrary, Unstructured};
6589 let mut buf = [0u8; 1024];
6590 rng.fill_bytes(&mut buf);
6591 let mut unstructured = Unstructured::new(&buf);
6592 Self::arbitrary(&mut unstructured).unwrap_or_default()
6593 }
6594}
6595impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
6596 fn default() -> Self {
6597 Self::DEFAULT.clone()
6598 }
6599}
6600impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
6601 type Message = MavMessage;
6602 const ID: u32 = 375u32;
6603 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
6604 const EXTRA_CRC: u8 = 251u8;
6605 const ENCODED_LEN: usize = 140usize;
6606 fn deser(
6607 _version: MavlinkVersion,
6608 __input: &[u8],
6609 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6610 let avail_len = __input.len();
6611 let mut payload_buf = [0; Self::ENCODED_LEN];
6612 let mut buf = if avail_len < Self::ENCODED_LEN {
6613 payload_buf[0..avail_len].copy_from_slice(__input);
6614 Bytes::new(&payload_buf)
6615 } else {
6616 Bytes::new(__input)
6617 };
6618 let mut __struct = Self::default();
6619 __struct.time_usec = buf.get_u64_le()?;
6620 __struct.active = buf.get_u32_le()?;
6621 for v in &mut __struct.actuator {
6622 let val = buf.get_f32_le()?;
6623 *v = val;
6624 }
6625 Ok(__struct)
6626 }
6627 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6628 let mut __tmp = BytesMut::new(bytes);
6629 #[allow(clippy::absurd_extreme_comparisons)]
6630 #[allow(unused_comparisons)]
6631 if __tmp.remaining() < Self::ENCODED_LEN {
6632 panic!(
6633 "buffer is too small (need {} bytes, but got {})",
6634 Self::ENCODED_LEN,
6635 __tmp.remaining(),
6636 )
6637 }
6638 __tmp.put_u64_le(self.time_usec);
6639 __tmp.put_u32_le(self.active);
6640 for val in &self.actuator {
6641 __tmp.put_f32_le(*val);
6642 }
6643 if matches!(version, MavlinkVersion::V2) {
6644 let len = __tmp.len();
6645 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6646 } else {
6647 __tmp.len()
6648 }
6649 }
6650}
6651#[doc = "The location and information of an ADSB vehicle."]
6652#[doc = ""]
6653#[doc = "ID: 246"]
6654#[derive(Debug, Clone, PartialEq)]
6655#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6656#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6657#[cfg_attr(feature = "ts", derive(TS))]
6658#[cfg_attr(feature = "ts", ts(export))]
6659pub struct ADSB_VEHICLE_DATA {
6660 #[doc = "ICAO address"]
6661 pub ICAO_address: u32,
6662 #[doc = "Latitude"]
6663 pub lat: i32,
6664 #[doc = "Longitude"]
6665 pub lon: i32,
6666 #[doc = "Altitude(ASL)"]
6667 pub altitude: i32,
6668 #[doc = "Course over ground"]
6669 pub heading: u16,
6670 #[doc = "The horizontal velocity"]
6671 pub hor_velocity: u16,
6672 #[doc = "The vertical velocity. Positive is up"]
6673 pub ver_velocity: i16,
6674 #[doc = "Bitmap to indicate various statuses including valid data fields"]
6675 pub flags: AdsbFlags,
6676 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
6677 pub squawk: u16,
6678 #[doc = "ADSB altitude type."]
6679 pub altitude_type: AdsbAltitudeType,
6680 #[doc = "The callsign, 8+null"]
6681 #[cfg_attr(feature = "ts", ts(type = "string"))]
6682 pub callsign: CharArray<9>,
6683 #[doc = "ADSB emitter type."]
6684 pub emitter_type: AdsbEmitterType,
6685 #[doc = "Time since last communication in seconds"]
6686 pub tslc: u8,
6687}
6688impl ADSB_VEHICLE_DATA {
6689 pub const ENCODED_LEN: usize = 38usize;
6690 pub const DEFAULT: Self = Self {
6691 ICAO_address: 0_u32,
6692 lat: 0_i32,
6693 lon: 0_i32,
6694 altitude: 0_i32,
6695 heading: 0_u16,
6696 hor_velocity: 0_u16,
6697 ver_velocity: 0_i16,
6698 flags: AdsbFlags::DEFAULT,
6699 squawk: 0_u16,
6700 altitude_type: AdsbAltitudeType::DEFAULT,
6701 callsign: CharArray::new([0_u8; 9usize]),
6702 emitter_type: AdsbEmitterType::DEFAULT,
6703 tslc: 0_u8,
6704 };
6705 #[cfg(feature = "arbitrary")]
6706 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6707 use arbitrary::{Arbitrary, Unstructured};
6708 let mut buf = [0u8; 1024];
6709 rng.fill_bytes(&mut buf);
6710 let mut unstructured = Unstructured::new(&buf);
6711 Self::arbitrary(&mut unstructured).unwrap_or_default()
6712 }
6713}
6714impl Default for ADSB_VEHICLE_DATA {
6715 fn default() -> Self {
6716 Self::DEFAULT.clone()
6717 }
6718}
6719impl MessageData for ADSB_VEHICLE_DATA {
6720 type Message = MavMessage;
6721 const ID: u32 = 246u32;
6722 const NAME: &'static str = "ADSB_VEHICLE";
6723 const EXTRA_CRC: u8 = 184u8;
6724 const ENCODED_LEN: usize = 38usize;
6725 fn deser(
6726 _version: MavlinkVersion,
6727 __input: &[u8],
6728 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6729 let avail_len = __input.len();
6730 let mut payload_buf = [0; Self::ENCODED_LEN];
6731 let mut buf = if avail_len < Self::ENCODED_LEN {
6732 payload_buf[0..avail_len].copy_from_slice(__input);
6733 Bytes::new(&payload_buf)
6734 } else {
6735 Bytes::new(__input)
6736 };
6737 let mut __struct = Self::default();
6738 __struct.ICAO_address = buf.get_u32_le()?;
6739 __struct.lat = buf.get_i32_le()?;
6740 __struct.lon = buf.get_i32_le()?;
6741 __struct.altitude = buf.get_i32_le()?;
6742 __struct.heading = buf.get_u16_le()?;
6743 __struct.hor_velocity = buf.get_u16_le()?;
6744 __struct.ver_velocity = buf.get_i16_le()?;
6745 let tmp = buf.get_u16_le()?;
6746 __struct.flags = AdsbFlags::from_bits(tmp as <AdsbFlags as Flags>::Bits).ok_or(
6747 ::mavlink_core::error::ParserError::InvalidFlag {
6748 flag_type: "AdsbFlags",
6749 value: tmp as u64,
6750 },
6751 )?;
6752 __struct.squawk = buf.get_u16_le()?;
6753 let tmp = buf.get_u8()?;
6754 __struct.altitude_type =
6755 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6756 enum_type: "AdsbAltitudeType",
6757 value: tmp as u64,
6758 })?;
6759 let mut tmp = [0_u8; 9usize];
6760 for v in &mut tmp {
6761 *v = buf.get_u8()?;
6762 }
6763 __struct.callsign = CharArray::new(tmp);
6764 let tmp = buf.get_u8()?;
6765 __struct.emitter_type =
6766 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6767 enum_type: "AdsbEmitterType",
6768 value: tmp as u64,
6769 })?;
6770 __struct.tslc = buf.get_u8()?;
6771 Ok(__struct)
6772 }
6773 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6774 let mut __tmp = BytesMut::new(bytes);
6775 #[allow(clippy::absurd_extreme_comparisons)]
6776 #[allow(unused_comparisons)]
6777 if __tmp.remaining() < Self::ENCODED_LEN {
6778 panic!(
6779 "buffer is too small (need {} bytes, but got {})",
6780 Self::ENCODED_LEN,
6781 __tmp.remaining(),
6782 )
6783 }
6784 __tmp.put_u32_le(self.ICAO_address);
6785 __tmp.put_i32_le(self.lat);
6786 __tmp.put_i32_le(self.lon);
6787 __tmp.put_i32_le(self.altitude);
6788 __tmp.put_u16_le(self.heading);
6789 __tmp.put_u16_le(self.hor_velocity);
6790 __tmp.put_i16_le(self.ver_velocity);
6791 __tmp.put_u16_le(self.flags.bits() as u16);
6792 __tmp.put_u16_le(self.squawk);
6793 __tmp.put_u8(self.altitude_type as u8);
6794 for val in &self.callsign {
6795 __tmp.put_u8(*val);
6796 }
6797 __tmp.put_u8(self.emitter_type as u8);
6798 __tmp.put_u8(self.tslc);
6799 if matches!(version, MavlinkVersion::V2) {
6800 let len = __tmp.len();
6801 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6802 } else {
6803 __tmp.len()
6804 }
6805 }
6806}
6807#[doc = "The location and information of an AIS vessel."]
6808#[doc = ""]
6809#[doc = "ID: 301"]
6810#[derive(Debug, Clone, PartialEq)]
6811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6812#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6813#[cfg_attr(feature = "ts", derive(TS))]
6814#[cfg_attr(feature = "ts", ts(export))]
6815pub struct AIS_VESSEL_DATA {
6816 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
6817 pub MMSI: u32,
6818 #[doc = "Latitude"]
6819 pub lat: i32,
6820 #[doc = "Longitude"]
6821 pub lon: i32,
6822 #[doc = "Course over ground"]
6823 pub COG: u16,
6824 #[doc = "True heading"]
6825 pub heading: u16,
6826 #[doc = "Speed over ground"]
6827 pub velocity: u16,
6828 #[doc = "Distance from lat/lon location to bow"]
6829 pub dimension_bow: u16,
6830 #[doc = "Distance from lat/lon location to stern"]
6831 pub dimension_stern: u16,
6832 #[doc = "Time since last communication in seconds"]
6833 pub tslc: u16,
6834 #[doc = "Bitmask to indicate various statuses including valid data fields"]
6835 pub flags: AisFlags,
6836 #[doc = "Turn rate"]
6837 pub turn_rate: i8,
6838 #[doc = "Navigational status"]
6839 pub navigational_status: AisNavStatus,
6840 #[doc = "Type of vessels"]
6841 pub mavtype: AisType,
6842 #[doc = "Distance from lat/lon location to port side"]
6843 pub dimension_port: u8,
6844 #[doc = "Distance from lat/lon location to starboard side"]
6845 pub dimension_starboard: u8,
6846 #[doc = "The vessel callsign"]
6847 #[cfg_attr(feature = "ts", ts(type = "string"))]
6848 pub callsign: CharArray<7>,
6849 #[doc = "The vessel name"]
6850 #[cfg_attr(feature = "ts", ts(type = "string"))]
6851 pub name: CharArray<20>,
6852}
6853impl AIS_VESSEL_DATA {
6854 pub const ENCODED_LEN: usize = 58usize;
6855 pub const DEFAULT: Self = Self {
6856 MMSI: 0_u32,
6857 lat: 0_i32,
6858 lon: 0_i32,
6859 COG: 0_u16,
6860 heading: 0_u16,
6861 velocity: 0_u16,
6862 dimension_bow: 0_u16,
6863 dimension_stern: 0_u16,
6864 tslc: 0_u16,
6865 flags: AisFlags::DEFAULT,
6866 turn_rate: 0_i8,
6867 navigational_status: AisNavStatus::DEFAULT,
6868 mavtype: AisType::DEFAULT,
6869 dimension_port: 0_u8,
6870 dimension_starboard: 0_u8,
6871 callsign: CharArray::new([0_u8; 7usize]),
6872 name: CharArray::new([0_u8; 20usize]),
6873 };
6874 #[cfg(feature = "arbitrary")]
6875 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6876 use arbitrary::{Arbitrary, Unstructured};
6877 let mut buf = [0u8; 1024];
6878 rng.fill_bytes(&mut buf);
6879 let mut unstructured = Unstructured::new(&buf);
6880 Self::arbitrary(&mut unstructured).unwrap_or_default()
6881 }
6882}
6883impl Default for AIS_VESSEL_DATA {
6884 fn default() -> Self {
6885 Self::DEFAULT.clone()
6886 }
6887}
6888impl MessageData for AIS_VESSEL_DATA {
6889 type Message = MavMessage;
6890 const ID: u32 = 301u32;
6891 const NAME: &'static str = "AIS_VESSEL";
6892 const EXTRA_CRC: u8 = 243u8;
6893 const ENCODED_LEN: usize = 58usize;
6894 fn deser(
6895 _version: MavlinkVersion,
6896 __input: &[u8],
6897 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6898 let avail_len = __input.len();
6899 let mut payload_buf = [0; Self::ENCODED_LEN];
6900 let mut buf = if avail_len < Self::ENCODED_LEN {
6901 payload_buf[0..avail_len].copy_from_slice(__input);
6902 Bytes::new(&payload_buf)
6903 } else {
6904 Bytes::new(__input)
6905 };
6906 let mut __struct = Self::default();
6907 __struct.MMSI = buf.get_u32_le()?;
6908 __struct.lat = buf.get_i32_le()?;
6909 __struct.lon = buf.get_i32_le()?;
6910 __struct.COG = buf.get_u16_le()?;
6911 __struct.heading = buf.get_u16_le()?;
6912 __struct.velocity = buf.get_u16_le()?;
6913 __struct.dimension_bow = buf.get_u16_le()?;
6914 __struct.dimension_stern = buf.get_u16_le()?;
6915 __struct.tslc = buf.get_u16_le()?;
6916 let tmp = buf.get_u16_le()?;
6917 __struct.flags = AisFlags::from_bits(tmp as <AisFlags as Flags>::Bits).ok_or(
6918 ::mavlink_core::error::ParserError::InvalidFlag {
6919 flag_type: "AisFlags",
6920 value: tmp as u64,
6921 },
6922 )?;
6923 __struct.turn_rate = buf.get_i8()?;
6924 let tmp = buf.get_u8()?;
6925 __struct.navigational_status =
6926 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6927 enum_type: "AisNavStatus",
6928 value: tmp as u64,
6929 })?;
6930 let tmp = buf.get_u8()?;
6931 __struct.mavtype =
6932 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6933 enum_type: "AisType",
6934 value: tmp as u64,
6935 })?;
6936 __struct.dimension_port = buf.get_u8()?;
6937 __struct.dimension_starboard = buf.get_u8()?;
6938 let mut tmp = [0_u8; 7usize];
6939 for v in &mut tmp {
6940 *v = buf.get_u8()?;
6941 }
6942 __struct.callsign = CharArray::new(tmp);
6943 let mut tmp = [0_u8; 20usize];
6944 for v in &mut tmp {
6945 *v = buf.get_u8()?;
6946 }
6947 __struct.name = CharArray::new(tmp);
6948 Ok(__struct)
6949 }
6950 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6951 let mut __tmp = BytesMut::new(bytes);
6952 #[allow(clippy::absurd_extreme_comparisons)]
6953 #[allow(unused_comparisons)]
6954 if __tmp.remaining() < Self::ENCODED_LEN {
6955 panic!(
6956 "buffer is too small (need {} bytes, but got {})",
6957 Self::ENCODED_LEN,
6958 __tmp.remaining(),
6959 )
6960 }
6961 __tmp.put_u32_le(self.MMSI);
6962 __tmp.put_i32_le(self.lat);
6963 __tmp.put_i32_le(self.lon);
6964 __tmp.put_u16_le(self.COG);
6965 __tmp.put_u16_le(self.heading);
6966 __tmp.put_u16_le(self.velocity);
6967 __tmp.put_u16_le(self.dimension_bow);
6968 __tmp.put_u16_le(self.dimension_stern);
6969 __tmp.put_u16_le(self.tslc);
6970 __tmp.put_u16_le(self.flags.bits() as u16);
6971 __tmp.put_i8(self.turn_rate);
6972 __tmp.put_u8(self.navigational_status as u8);
6973 __tmp.put_u8(self.mavtype as u8);
6974 __tmp.put_u8(self.dimension_port);
6975 __tmp.put_u8(self.dimension_starboard);
6976 for val in &self.callsign {
6977 __tmp.put_u8(*val);
6978 }
6979 for val in &self.name {
6980 __tmp.put_u8(*val);
6981 }
6982 if matches!(version, MavlinkVersion::V2) {
6983 let len = __tmp.len();
6984 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6985 } else {
6986 __tmp.len()
6987 }
6988 }
6989}
6990#[doc = "The current system altitude."]
6991#[doc = ""]
6992#[doc = "ID: 141"]
6993#[derive(Debug, Clone, PartialEq)]
6994#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6995#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6996#[cfg_attr(feature = "ts", derive(TS))]
6997#[cfg_attr(feature = "ts", ts(export))]
6998pub struct ALTITUDE_DATA {
6999 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7000 pub time_usec: u64,
7001 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
7002 pub altitude_monotonic: f32,
7003 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
7004 pub altitude_amsl: f32,
7005 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
7006 pub altitude_local: f32,
7007 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
7008 pub altitude_relative: f32,
7009 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
7010 pub altitude_terrain: f32,
7011 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
7012 pub bottom_clearance: f32,
7013}
7014impl ALTITUDE_DATA {
7015 pub const ENCODED_LEN: usize = 32usize;
7016 pub const DEFAULT: Self = Self {
7017 time_usec: 0_u64,
7018 altitude_monotonic: 0.0_f32,
7019 altitude_amsl: 0.0_f32,
7020 altitude_local: 0.0_f32,
7021 altitude_relative: 0.0_f32,
7022 altitude_terrain: 0.0_f32,
7023 bottom_clearance: 0.0_f32,
7024 };
7025 #[cfg(feature = "arbitrary")]
7026 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7027 use arbitrary::{Arbitrary, Unstructured};
7028 let mut buf = [0u8; 1024];
7029 rng.fill_bytes(&mut buf);
7030 let mut unstructured = Unstructured::new(&buf);
7031 Self::arbitrary(&mut unstructured).unwrap_or_default()
7032 }
7033}
7034impl Default for ALTITUDE_DATA {
7035 fn default() -> Self {
7036 Self::DEFAULT.clone()
7037 }
7038}
7039impl MessageData for ALTITUDE_DATA {
7040 type Message = MavMessage;
7041 const ID: u32 = 141u32;
7042 const NAME: &'static str = "ALTITUDE";
7043 const EXTRA_CRC: u8 = 47u8;
7044 const ENCODED_LEN: usize = 32usize;
7045 fn deser(
7046 _version: MavlinkVersion,
7047 __input: &[u8],
7048 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7049 let avail_len = __input.len();
7050 let mut payload_buf = [0; Self::ENCODED_LEN];
7051 let mut buf = if avail_len < Self::ENCODED_LEN {
7052 payload_buf[0..avail_len].copy_from_slice(__input);
7053 Bytes::new(&payload_buf)
7054 } else {
7055 Bytes::new(__input)
7056 };
7057 let mut __struct = Self::default();
7058 __struct.time_usec = buf.get_u64_le()?;
7059 __struct.altitude_monotonic = buf.get_f32_le()?;
7060 __struct.altitude_amsl = buf.get_f32_le()?;
7061 __struct.altitude_local = buf.get_f32_le()?;
7062 __struct.altitude_relative = buf.get_f32_le()?;
7063 __struct.altitude_terrain = buf.get_f32_le()?;
7064 __struct.bottom_clearance = buf.get_f32_le()?;
7065 Ok(__struct)
7066 }
7067 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7068 let mut __tmp = BytesMut::new(bytes);
7069 #[allow(clippy::absurd_extreme_comparisons)]
7070 #[allow(unused_comparisons)]
7071 if __tmp.remaining() < Self::ENCODED_LEN {
7072 panic!(
7073 "buffer is too small (need {} bytes, but got {})",
7074 Self::ENCODED_LEN,
7075 __tmp.remaining(),
7076 )
7077 }
7078 __tmp.put_u64_le(self.time_usec);
7079 __tmp.put_f32_le(self.altitude_monotonic);
7080 __tmp.put_f32_le(self.altitude_amsl);
7081 __tmp.put_f32_le(self.altitude_local);
7082 __tmp.put_f32_le(self.altitude_relative);
7083 __tmp.put_f32_le(self.altitude_terrain);
7084 __tmp.put_f32_le(self.bottom_clearance);
7085 if matches!(version, MavlinkVersion::V2) {
7086 let len = __tmp.len();
7087 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7088 } else {
7089 __tmp.len()
7090 }
7091 }
7092}
7093#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
7094#[doc = ""]
7095#[doc = "ID: 30"]
7096#[derive(Debug, Clone, PartialEq)]
7097#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7098#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7099#[cfg_attr(feature = "ts", derive(TS))]
7100#[cfg_attr(feature = "ts", ts(export))]
7101pub struct ATTITUDE_DATA {
7102 #[doc = "Timestamp (time since system boot)."]
7103 pub time_boot_ms: u32,
7104 #[doc = "Roll angle (-pi..+pi)"]
7105 pub roll: f32,
7106 #[doc = "Pitch angle (-pi..+pi)"]
7107 pub pitch: f32,
7108 #[doc = "Yaw angle (-pi..+pi)"]
7109 pub yaw: f32,
7110 #[doc = "Roll angular speed"]
7111 pub rollspeed: f32,
7112 #[doc = "Pitch angular speed"]
7113 pub pitchspeed: f32,
7114 #[doc = "Yaw angular speed"]
7115 pub yawspeed: f32,
7116}
7117impl ATTITUDE_DATA {
7118 pub const ENCODED_LEN: usize = 28usize;
7119 pub const DEFAULT: Self = Self {
7120 time_boot_ms: 0_u32,
7121 roll: 0.0_f32,
7122 pitch: 0.0_f32,
7123 yaw: 0.0_f32,
7124 rollspeed: 0.0_f32,
7125 pitchspeed: 0.0_f32,
7126 yawspeed: 0.0_f32,
7127 };
7128 #[cfg(feature = "arbitrary")]
7129 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7130 use arbitrary::{Arbitrary, Unstructured};
7131 let mut buf = [0u8; 1024];
7132 rng.fill_bytes(&mut buf);
7133 let mut unstructured = Unstructured::new(&buf);
7134 Self::arbitrary(&mut unstructured).unwrap_or_default()
7135 }
7136}
7137impl Default for ATTITUDE_DATA {
7138 fn default() -> Self {
7139 Self::DEFAULT.clone()
7140 }
7141}
7142impl MessageData for ATTITUDE_DATA {
7143 type Message = MavMessage;
7144 const ID: u32 = 30u32;
7145 const NAME: &'static str = "ATTITUDE";
7146 const EXTRA_CRC: u8 = 39u8;
7147 const ENCODED_LEN: usize = 28usize;
7148 fn deser(
7149 _version: MavlinkVersion,
7150 __input: &[u8],
7151 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7152 let avail_len = __input.len();
7153 let mut payload_buf = [0; Self::ENCODED_LEN];
7154 let mut buf = if avail_len < Self::ENCODED_LEN {
7155 payload_buf[0..avail_len].copy_from_slice(__input);
7156 Bytes::new(&payload_buf)
7157 } else {
7158 Bytes::new(__input)
7159 };
7160 let mut __struct = Self::default();
7161 __struct.time_boot_ms = buf.get_u32_le()?;
7162 __struct.roll = buf.get_f32_le()?;
7163 __struct.pitch = buf.get_f32_le()?;
7164 __struct.yaw = buf.get_f32_le()?;
7165 __struct.rollspeed = buf.get_f32_le()?;
7166 __struct.pitchspeed = buf.get_f32_le()?;
7167 __struct.yawspeed = buf.get_f32_le()?;
7168 Ok(__struct)
7169 }
7170 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7171 let mut __tmp = BytesMut::new(bytes);
7172 #[allow(clippy::absurd_extreme_comparisons)]
7173 #[allow(unused_comparisons)]
7174 if __tmp.remaining() < Self::ENCODED_LEN {
7175 panic!(
7176 "buffer is too small (need {} bytes, but got {})",
7177 Self::ENCODED_LEN,
7178 __tmp.remaining(),
7179 )
7180 }
7181 __tmp.put_u32_le(self.time_boot_ms);
7182 __tmp.put_f32_le(self.roll);
7183 __tmp.put_f32_le(self.pitch);
7184 __tmp.put_f32_le(self.yaw);
7185 __tmp.put_f32_le(self.rollspeed);
7186 __tmp.put_f32_le(self.pitchspeed);
7187 __tmp.put_f32_le(self.yawspeed);
7188 if matches!(version, MavlinkVersion::V2) {
7189 let len = __tmp.len();
7190 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7191 } else {
7192 __tmp.len()
7193 }
7194 }
7195}
7196#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
7197#[doc = ""]
7198#[doc = "ID: 31"]
7199#[derive(Debug, Clone, PartialEq)]
7200#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7201#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7202#[cfg_attr(feature = "ts", derive(TS))]
7203#[cfg_attr(feature = "ts", ts(export))]
7204pub struct ATTITUDE_QUATERNION_DATA {
7205 #[doc = "Timestamp (time since system boot)."]
7206 pub time_boot_ms: u32,
7207 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
7208 pub q1: f32,
7209 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
7210 pub q2: f32,
7211 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
7212 pub q3: f32,
7213 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
7214 pub q4: f32,
7215 #[doc = "Roll angular speed"]
7216 pub rollspeed: f32,
7217 #[doc = "Pitch angular speed"]
7218 pub pitchspeed: f32,
7219 #[doc = "Yaw angular speed"]
7220 pub yawspeed: f32,
7221 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
7222 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7223 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7224 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7225 pub repr_offset_q: [f32; 4],
7226}
7227impl ATTITUDE_QUATERNION_DATA {
7228 pub const ENCODED_LEN: usize = 48usize;
7229 pub const DEFAULT: Self = Self {
7230 time_boot_ms: 0_u32,
7231 q1: 0.0_f32,
7232 q2: 0.0_f32,
7233 q3: 0.0_f32,
7234 q4: 0.0_f32,
7235 rollspeed: 0.0_f32,
7236 pitchspeed: 0.0_f32,
7237 yawspeed: 0.0_f32,
7238 repr_offset_q: [0.0_f32; 4usize],
7239 };
7240 #[cfg(feature = "arbitrary")]
7241 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7242 use arbitrary::{Arbitrary, Unstructured};
7243 let mut buf = [0u8; 1024];
7244 rng.fill_bytes(&mut buf);
7245 let mut unstructured = Unstructured::new(&buf);
7246 Self::arbitrary(&mut unstructured).unwrap_or_default()
7247 }
7248}
7249impl Default for ATTITUDE_QUATERNION_DATA {
7250 fn default() -> Self {
7251 Self::DEFAULT.clone()
7252 }
7253}
7254impl MessageData for ATTITUDE_QUATERNION_DATA {
7255 type Message = MavMessage;
7256 const ID: u32 = 31u32;
7257 const NAME: &'static str = "ATTITUDE_QUATERNION";
7258 const EXTRA_CRC: u8 = 246u8;
7259 const ENCODED_LEN: usize = 48usize;
7260 fn deser(
7261 _version: MavlinkVersion,
7262 __input: &[u8],
7263 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7264 let avail_len = __input.len();
7265 let mut payload_buf = [0; Self::ENCODED_LEN];
7266 let mut buf = if avail_len < Self::ENCODED_LEN {
7267 payload_buf[0..avail_len].copy_from_slice(__input);
7268 Bytes::new(&payload_buf)
7269 } else {
7270 Bytes::new(__input)
7271 };
7272 let mut __struct = Self::default();
7273 __struct.time_boot_ms = buf.get_u32_le()?;
7274 __struct.q1 = buf.get_f32_le()?;
7275 __struct.q2 = buf.get_f32_le()?;
7276 __struct.q3 = buf.get_f32_le()?;
7277 __struct.q4 = buf.get_f32_le()?;
7278 __struct.rollspeed = buf.get_f32_le()?;
7279 __struct.pitchspeed = buf.get_f32_le()?;
7280 __struct.yawspeed = buf.get_f32_le()?;
7281 for v in &mut __struct.repr_offset_q {
7282 let val = buf.get_f32_le()?;
7283 *v = val;
7284 }
7285 Ok(__struct)
7286 }
7287 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7288 let mut __tmp = BytesMut::new(bytes);
7289 #[allow(clippy::absurd_extreme_comparisons)]
7290 #[allow(unused_comparisons)]
7291 if __tmp.remaining() < Self::ENCODED_LEN {
7292 panic!(
7293 "buffer is too small (need {} bytes, but got {})",
7294 Self::ENCODED_LEN,
7295 __tmp.remaining(),
7296 )
7297 }
7298 __tmp.put_u32_le(self.time_boot_ms);
7299 __tmp.put_f32_le(self.q1);
7300 __tmp.put_f32_le(self.q2);
7301 __tmp.put_f32_le(self.q3);
7302 __tmp.put_f32_le(self.q4);
7303 __tmp.put_f32_le(self.rollspeed);
7304 __tmp.put_f32_le(self.pitchspeed);
7305 __tmp.put_f32_le(self.yawspeed);
7306 if matches!(version, MavlinkVersion::V2) {
7307 for val in &self.repr_offset_q {
7308 __tmp.put_f32_le(*val);
7309 }
7310 let len = __tmp.len();
7311 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7312 } else {
7313 __tmp.len()
7314 }
7315 }
7316}
7317#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
7318#[doc = ""]
7319#[doc = "ID: 61"]
7320#[derive(Debug, Clone, PartialEq)]
7321#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7322#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7323#[cfg_attr(feature = "ts", derive(TS))]
7324#[cfg_attr(feature = "ts", ts(export))]
7325pub struct ATTITUDE_QUATERNION_COV_DATA {
7326 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7327 pub time_usec: u64,
7328 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
7329 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7330 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7331 pub q: [f32; 4],
7332 #[doc = "Roll angular speed"]
7333 pub rollspeed: f32,
7334 #[doc = "Pitch angular speed"]
7335 pub pitchspeed: f32,
7336 #[doc = "Yaw angular speed"]
7337 pub yawspeed: f32,
7338 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
7339 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7340 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7341 pub covariance: [f32; 9],
7342}
7343impl ATTITUDE_QUATERNION_COV_DATA {
7344 pub const ENCODED_LEN: usize = 72usize;
7345 pub const DEFAULT: Self = Self {
7346 time_usec: 0_u64,
7347 q: [0.0_f32; 4usize],
7348 rollspeed: 0.0_f32,
7349 pitchspeed: 0.0_f32,
7350 yawspeed: 0.0_f32,
7351 covariance: [0.0_f32; 9usize],
7352 };
7353 #[cfg(feature = "arbitrary")]
7354 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7355 use arbitrary::{Arbitrary, Unstructured};
7356 let mut buf = [0u8; 1024];
7357 rng.fill_bytes(&mut buf);
7358 let mut unstructured = Unstructured::new(&buf);
7359 Self::arbitrary(&mut unstructured).unwrap_or_default()
7360 }
7361}
7362impl Default for ATTITUDE_QUATERNION_COV_DATA {
7363 fn default() -> Self {
7364 Self::DEFAULT.clone()
7365 }
7366}
7367impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
7368 type Message = MavMessage;
7369 const ID: u32 = 61u32;
7370 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
7371 const EXTRA_CRC: u8 = 167u8;
7372 const ENCODED_LEN: usize = 72usize;
7373 fn deser(
7374 _version: MavlinkVersion,
7375 __input: &[u8],
7376 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7377 let avail_len = __input.len();
7378 let mut payload_buf = [0; Self::ENCODED_LEN];
7379 let mut buf = if avail_len < Self::ENCODED_LEN {
7380 payload_buf[0..avail_len].copy_from_slice(__input);
7381 Bytes::new(&payload_buf)
7382 } else {
7383 Bytes::new(__input)
7384 };
7385 let mut __struct = Self::default();
7386 __struct.time_usec = buf.get_u64_le()?;
7387 for v in &mut __struct.q {
7388 let val = buf.get_f32_le()?;
7389 *v = val;
7390 }
7391 __struct.rollspeed = buf.get_f32_le()?;
7392 __struct.pitchspeed = buf.get_f32_le()?;
7393 __struct.yawspeed = buf.get_f32_le()?;
7394 for v in &mut __struct.covariance {
7395 let val = buf.get_f32_le()?;
7396 *v = val;
7397 }
7398 Ok(__struct)
7399 }
7400 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7401 let mut __tmp = BytesMut::new(bytes);
7402 #[allow(clippy::absurd_extreme_comparisons)]
7403 #[allow(unused_comparisons)]
7404 if __tmp.remaining() < Self::ENCODED_LEN {
7405 panic!(
7406 "buffer is too small (need {} bytes, but got {})",
7407 Self::ENCODED_LEN,
7408 __tmp.remaining(),
7409 )
7410 }
7411 __tmp.put_u64_le(self.time_usec);
7412 for val in &self.q {
7413 __tmp.put_f32_le(*val);
7414 }
7415 __tmp.put_f32_le(self.rollspeed);
7416 __tmp.put_f32_le(self.pitchspeed);
7417 __tmp.put_f32_le(self.yawspeed);
7418 for val in &self.covariance {
7419 __tmp.put_f32_le(*val);
7420 }
7421 if matches!(version, MavlinkVersion::V2) {
7422 let len = __tmp.len();
7423 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7424 } else {
7425 __tmp.len()
7426 }
7427 }
7428}
7429#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
7430#[doc = ""]
7431#[doc = "ID: 83"]
7432#[derive(Debug, Clone, PartialEq)]
7433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7434#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7435#[cfg_attr(feature = "ts", derive(TS))]
7436#[cfg_attr(feature = "ts", ts(export))]
7437pub struct ATTITUDE_TARGET_DATA {
7438 #[doc = "Timestamp (time since system boot)."]
7439 pub time_boot_ms: u32,
7440 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7441 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7442 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7443 pub q: [f32; 4],
7444 #[doc = "Body roll rate"]
7445 pub body_roll_rate: f32,
7446 #[doc = "Body pitch rate"]
7447 pub body_pitch_rate: f32,
7448 #[doc = "Body yaw rate"]
7449 pub body_yaw_rate: f32,
7450 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
7451 pub thrust: f32,
7452 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
7453 pub type_mask: AttitudeTargetTypemask,
7454}
7455impl ATTITUDE_TARGET_DATA {
7456 pub const ENCODED_LEN: usize = 37usize;
7457 pub const DEFAULT: Self = Self {
7458 time_boot_ms: 0_u32,
7459 q: [0.0_f32; 4usize],
7460 body_roll_rate: 0.0_f32,
7461 body_pitch_rate: 0.0_f32,
7462 body_yaw_rate: 0.0_f32,
7463 thrust: 0.0_f32,
7464 type_mask: AttitudeTargetTypemask::DEFAULT,
7465 };
7466 #[cfg(feature = "arbitrary")]
7467 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7468 use arbitrary::{Arbitrary, Unstructured};
7469 let mut buf = [0u8; 1024];
7470 rng.fill_bytes(&mut buf);
7471 let mut unstructured = Unstructured::new(&buf);
7472 Self::arbitrary(&mut unstructured).unwrap_or_default()
7473 }
7474}
7475impl Default for ATTITUDE_TARGET_DATA {
7476 fn default() -> Self {
7477 Self::DEFAULT.clone()
7478 }
7479}
7480impl MessageData for ATTITUDE_TARGET_DATA {
7481 type Message = MavMessage;
7482 const ID: u32 = 83u32;
7483 const NAME: &'static str = "ATTITUDE_TARGET";
7484 const EXTRA_CRC: u8 = 22u8;
7485 const ENCODED_LEN: usize = 37usize;
7486 fn deser(
7487 _version: MavlinkVersion,
7488 __input: &[u8],
7489 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7490 let avail_len = __input.len();
7491 let mut payload_buf = [0; Self::ENCODED_LEN];
7492 let mut buf = if avail_len < Self::ENCODED_LEN {
7493 payload_buf[0..avail_len].copy_from_slice(__input);
7494 Bytes::new(&payload_buf)
7495 } else {
7496 Bytes::new(__input)
7497 };
7498 let mut __struct = Self::default();
7499 __struct.time_boot_ms = buf.get_u32_le()?;
7500 for v in &mut __struct.q {
7501 let val = buf.get_f32_le()?;
7502 *v = val;
7503 }
7504 __struct.body_roll_rate = buf.get_f32_le()?;
7505 __struct.body_pitch_rate = buf.get_f32_le()?;
7506 __struct.body_yaw_rate = buf.get_f32_le()?;
7507 __struct.thrust = buf.get_f32_le()?;
7508 let tmp = buf.get_u8()?;
7509 __struct.type_mask =
7510 AttitudeTargetTypemask::from_bits(tmp as <AttitudeTargetTypemask as Flags>::Bits)
7511 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7512 flag_type: "AttitudeTargetTypemask",
7513 value: tmp as u64,
7514 })?;
7515 Ok(__struct)
7516 }
7517 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7518 let mut __tmp = BytesMut::new(bytes);
7519 #[allow(clippy::absurd_extreme_comparisons)]
7520 #[allow(unused_comparisons)]
7521 if __tmp.remaining() < Self::ENCODED_LEN {
7522 panic!(
7523 "buffer is too small (need {} bytes, but got {})",
7524 Self::ENCODED_LEN,
7525 __tmp.remaining(),
7526 )
7527 }
7528 __tmp.put_u32_le(self.time_boot_ms);
7529 for val in &self.q {
7530 __tmp.put_f32_le(*val);
7531 }
7532 __tmp.put_f32_le(self.body_roll_rate);
7533 __tmp.put_f32_le(self.body_pitch_rate);
7534 __tmp.put_f32_le(self.body_yaw_rate);
7535 __tmp.put_f32_le(self.thrust);
7536 __tmp.put_u8(self.type_mask.bits() as u8);
7537 if matches!(version, MavlinkVersion::V2) {
7538 let len = __tmp.len();
7539 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7540 } else {
7541 __tmp.len()
7542 }
7543 }
7544}
7545#[doc = "Motion capture attitude and position."]
7546#[doc = ""]
7547#[doc = "ID: 138"]
7548#[derive(Debug, Clone, PartialEq)]
7549#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7550#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7551#[cfg_attr(feature = "ts", derive(TS))]
7552#[cfg_attr(feature = "ts", ts(export))]
7553pub struct ATT_POS_MOCAP_DATA {
7554 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7555 pub time_usec: u64,
7556 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7557 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7558 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7559 pub q: [f32; 4],
7560 #[doc = "X position (NED)"]
7561 pub x: f32,
7562 #[doc = "Y position (NED)"]
7563 pub y: f32,
7564 #[doc = "Z position (NED)"]
7565 pub z: f32,
7566 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
7567 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7568 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7569 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7570 pub covariance: [f32; 21],
7571}
7572impl ATT_POS_MOCAP_DATA {
7573 pub const ENCODED_LEN: usize = 120usize;
7574 pub const DEFAULT: Self = Self {
7575 time_usec: 0_u64,
7576 q: [0.0_f32; 4usize],
7577 x: 0.0_f32,
7578 y: 0.0_f32,
7579 z: 0.0_f32,
7580 covariance: [0.0_f32; 21usize],
7581 };
7582 #[cfg(feature = "arbitrary")]
7583 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7584 use arbitrary::{Arbitrary, Unstructured};
7585 let mut buf = [0u8; 1024];
7586 rng.fill_bytes(&mut buf);
7587 let mut unstructured = Unstructured::new(&buf);
7588 Self::arbitrary(&mut unstructured).unwrap_or_default()
7589 }
7590}
7591impl Default for ATT_POS_MOCAP_DATA {
7592 fn default() -> Self {
7593 Self::DEFAULT.clone()
7594 }
7595}
7596impl MessageData for ATT_POS_MOCAP_DATA {
7597 type Message = MavMessage;
7598 const ID: u32 = 138u32;
7599 const NAME: &'static str = "ATT_POS_MOCAP";
7600 const EXTRA_CRC: u8 = 109u8;
7601 const ENCODED_LEN: usize = 120usize;
7602 fn deser(
7603 _version: MavlinkVersion,
7604 __input: &[u8],
7605 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7606 let avail_len = __input.len();
7607 let mut payload_buf = [0; Self::ENCODED_LEN];
7608 let mut buf = if avail_len < Self::ENCODED_LEN {
7609 payload_buf[0..avail_len].copy_from_slice(__input);
7610 Bytes::new(&payload_buf)
7611 } else {
7612 Bytes::new(__input)
7613 };
7614 let mut __struct = Self::default();
7615 __struct.time_usec = buf.get_u64_le()?;
7616 for v in &mut __struct.q {
7617 let val = buf.get_f32_le()?;
7618 *v = val;
7619 }
7620 __struct.x = buf.get_f32_le()?;
7621 __struct.y = buf.get_f32_le()?;
7622 __struct.z = buf.get_f32_le()?;
7623 for v in &mut __struct.covariance {
7624 let val = buf.get_f32_le()?;
7625 *v = val;
7626 }
7627 Ok(__struct)
7628 }
7629 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7630 let mut __tmp = BytesMut::new(bytes);
7631 #[allow(clippy::absurd_extreme_comparisons)]
7632 #[allow(unused_comparisons)]
7633 if __tmp.remaining() < Self::ENCODED_LEN {
7634 panic!(
7635 "buffer is too small (need {} bytes, but got {})",
7636 Self::ENCODED_LEN,
7637 __tmp.remaining(),
7638 )
7639 }
7640 __tmp.put_u64_le(self.time_usec);
7641 for val in &self.q {
7642 __tmp.put_f32_le(*val);
7643 }
7644 __tmp.put_f32_le(self.x);
7645 __tmp.put_f32_le(self.y);
7646 __tmp.put_f32_le(self.z);
7647 if matches!(version, MavlinkVersion::V2) {
7648 for val in &self.covariance {
7649 __tmp.put_f32_le(*val);
7650 }
7651 let len = __tmp.len();
7652 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7653 } else {
7654 __tmp.len()
7655 }
7656 }
7657}
7658#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
7659#[doc = ""]
7660#[doc = "ID: 7"]
7661#[derive(Debug, Clone, PartialEq)]
7662#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7663#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7664#[cfg_attr(feature = "ts", derive(TS))]
7665#[cfg_attr(feature = "ts", ts(export))]
7666pub struct AUTH_KEY_DATA {
7667 #[doc = "key"]
7668 #[cfg_attr(feature = "ts", ts(type = "string"))]
7669 pub key: CharArray<32>,
7670}
7671impl AUTH_KEY_DATA {
7672 pub const ENCODED_LEN: usize = 32usize;
7673 pub const DEFAULT: Self = Self {
7674 key: CharArray::new([0_u8; 32usize]),
7675 };
7676 #[cfg(feature = "arbitrary")]
7677 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7678 use arbitrary::{Arbitrary, Unstructured};
7679 let mut buf = [0u8; 1024];
7680 rng.fill_bytes(&mut buf);
7681 let mut unstructured = Unstructured::new(&buf);
7682 Self::arbitrary(&mut unstructured).unwrap_or_default()
7683 }
7684}
7685impl Default for AUTH_KEY_DATA {
7686 fn default() -> Self {
7687 Self::DEFAULT.clone()
7688 }
7689}
7690impl MessageData for AUTH_KEY_DATA {
7691 type Message = MavMessage;
7692 const ID: u32 = 7u32;
7693 const NAME: &'static str = "AUTH_KEY";
7694 const EXTRA_CRC: u8 = 119u8;
7695 const ENCODED_LEN: usize = 32usize;
7696 fn deser(
7697 _version: MavlinkVersion,
7698 __input: &[u8],
7699 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7700 let avail_len = __input.len();
7701 let mut payload_buf = [0; Self::ENCODED_LEN];
7702 let mut buf = if avail_len < Self::ENCODED_LEN {
7703 payload_buf[0..avail_len].copy_from_slice(__input);
7704 Bytes::new(&payload_buf)
7705 } else {
7706 Bytes::new(__input)
7707 };
7708 let mut __struct = Self::default();
7709 let mut tmp = [0_u8; 32usize];
7710 for v in &mut tmp {
7711 *v = buf.get_u8()?;
7712 }
7713 __struct.key = CharArray::new(tmp);
7714 Ok(__struct)
7715 }
7716 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7717 let mut __tmp = BytesMut::new(bytes);
7718 #[allow(clippy::absurd_extreme_comparisons)]
7719 #[allow(unused_comparisons)]
7720 if __tmp.remaining() < Self::ENCODED_LEN {
7721 panic!(
7722 "buffer is too small (need {} bytes, but got {})",
7723 Self::ENCODED_LEN,
7724 __tmp.remaining(),
7725 )
7726 }
7727 for val in &self.key {
7728 __tmp.put_u8(*val);
7729 }
7730 if matches!(version, MavlinkVersion::V2) {
7731 let len = __tmp.len();
7732 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7733 } else {
7734 __tmp.len()
7735 }
7736 }
7737}
7738#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
7739#[doc = ""]
7740#[doc = "ID: 286"]
7741#[derive(Debug, Clone, PartialEq)]
7742#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7743#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7744#[cfg_attr(feature = "ts", derive(TS))]
7745#[cfg_attr(feature = "ts", ts(export))]
7746pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
7747 #[doc = "Timestamp (time since system boot)."]
7748 pub time_boot_us: u64,
7749 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
7750 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7751 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7752 pub q: [f32; 4],
7753 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
7754 pub q_estimated_delay_us: u32,
7755 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
7756 pub vx: f32,
7757 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
7758 pub vy: f32,
7759 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
7760 pub vz: f32,
7761 #[doc = "Estimated delay of the speed data. 0 if unknown."]
7762 pub v_estimated_delay_us: u32,
7763 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
7764 pub feed_forward_angular_velocity_z: f32,
7765 #[doc = "Bitmap indicating which estimator outputs are valid."]
7766 pub estimator_status: EstimatorStatusFlags,
7767 #[doc = "System ID"]
7768 pub target_system: u8,
7769 #[doc = "Component ID"]
7770 pub target_component: u8,
7771 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
7772 pub landed_state: MavLandedState,
7773 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
7774 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7775 pub angular_velocity_z: f32,
7776}
7777impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
7778 pub const ENCODED_LEN: usize = 57usize;
7779 pub const DEFAULT: Self = Self {
7780 time_boot_us: 0_u64,
7781 q: [0.0_f32; 4usize],
7782 q_estimated_delay_us: 0_u32,
7783 vx: 0.0_f32,
7784 vy: 0.0_f32,
7785 vz: 0.0_f32,
7786 v_estimated_delay_us: 0_u32,
7787 feed_forward_angular_velocity_z: 0.0_f32,
7788 estimator_status: EstimatorStatusFlags::DEFAULT,
7789 target_system: 0_u8,
7790 target_component: 0_u8,
7791 landed_state: MavLandedState::DEFAULT,
7792 angular_velocity_z: 0.0_f32,
7793 };
7794 #[cfg(feature = "arbitrary")]
7795 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7796 use arbitrary::{Arbitrary, Unstructured};
7797 let mut buf = [0u8; 1024];
7798 rng.fill_bytes(&mut buf);
7799 let mut unstructured = Unstructured::new(&buf);
7800 Self::arbitrary(&mut unstructured).unwrap_or_default()
7801 }
7802}
7803impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
7804 fn default() -> Self {
7805 Self::DEFAULT.clone()
7806 }
7807}
7808impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
7809 type Message = MavMessage;
7810 const ID: u32 = 286u32;
7811 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
7812 const EXTRA_CRC: u8 = 210u8;
7813 const ENCODED_LEN: usize = 57usize;
7814 fn deser(
7815 _version: MavlinkVersion,
7816 __input: &[u8],
7817 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7818 let avail_len = __input.len();
7819 let mut payload_buf = [0; Self::ENCODED_LEN];
7820 let mut buf = if avail_len < Self::ENCODED_LEN {
7821 payload_buf[0..avail_len].copy_from_slice(__input);
7822 Bytes::new(&payload_buf)
7823 } else {
7824 Bytes::new(__input)
7825 };
7826 let mut __struct = Self::default();
7827 __struct.time_boot_us = buf.get_u64_le()?;
7828 for v in &mut __struct.q {
7829 let val = buf.get_f32_le()?;
7830 *v = val;
7831 }
7832 __struct.q_estimated_delay_us = buf.get_u32_le()?;
7833 __struct.vx = buf.get_f32_le()?;
7834 __struct.vy = buf.get_f32_le()?;
7835 __struct.vz = buf.get_f32_le()?;
7836 __struct.v_estimated_delay_us = buf.get_u32_le()?;
7837 __struct.feed_forward_angular_velocity_z = buf.get_f32_le()?;
7838 let tmp = buf.get_u16_le()?;
7839 __struct.estimator_status = EstimatorStatusFlags::from_bits(
7840 tmp as <EstimatorStatusFlags as Flags>::Bits,
7841 )
7842 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7843 flag_type: "EstimatorStatusFlags",
7844 value: tmp as u64,
7845 })?;
7846 __struct.target_system = buf.get_u8()?;
7847 __struct.target_component = buf.get_u8()?;
7848 let tmp = buf.get_u8()?;
7849 __struct.landed_state =
7850 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7851 enum_type: "MavLandedState",
7852 value: tmp as u64,
7853 })?;
7854 __struct.angular_velocity_z = buf.get_f32_le()?;
7855 Ok(__struct)
7856 }
7857 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7858 let mut __tmp = BytesMut::new(bytes);
7859 #[allow(clippy::absurd_extreme_comparisons)]
7860 #[allow(unused_comparisons)]
7861 if __tmp.remaining() < Self::ENCODED_LEN {
7862 panic!(
7863 "buffer is too small (need {} bytes, but got {})",
7864 Self::ENCODED_LEN,
7865 __tmp.remaining(),
7866 )
7867 }
7868 __tmp.put_u64_le(self.time_boot_us);
7869 for val in &self.q {
7870 __tmp.put_f32_le(*val);
7871 }
7872 __tmp.put_u32_le(self.q_estimated_delay_us);
7873 __tmp.put_f32_le(self.vx);
7874 __tmp.put_f32_le(self.vy);
7875 __tmp.put_f32_le(self.vz);
7876 __tmp.put_u32_le(self.v_estimated_delay_us);
7877 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
7878 __tmp.put_u16_le(self.estimator_status.bits() as u16);
7879 __tmp.put_u8(self.target_system);
7880 __tmp.put_u8(self.target_component);
7881 __tmp.put_u8(self.landed_state as u8);
7882 if matches!(version, MavlinkVersion::V2) {
7883 __tmp.put_f32_le(self.angular_velocity_z);
7884 let len = __tmp.len();
7885 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7886 } else {
7887 __tmp.len()
7888 }
7889 }
7890}
7891#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
7892#[doc = ""]
7893#[doc = "ID: 148"]
7894#[derive(Debug, Clone, PartialEq)]
7895#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7896#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7897#[cfg_attr(feature = "ts", derive(TS))]
7898#[cfg_attr(feature = "ts", ts(export))]
7899pub struct AUTOPILOT_VERSION_DATA {
7900 #[doc = "Bitmap of capabilities"]
7901 pub capabilities: MavProtocolCapability,
7902 #[doc = "UID if provided by hardware (see uid2)"]
7903 pub uid: u64,
7904 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
7905 pub flight_sw_version: u32,
7906 #[doc = "Middleware version number"]
7907 pub middleware_sw_version: u32,
7908 #[doc = "Operating system version number"]
7909 pub os_sw_version: u32,
7910 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
7911 pub board_version: u32,
7912 #[doc = "ID of the board vendor"]
7913 pub vendor_id: u16,
7914 #[doc = "ID of the product"]
7915 pub product_id: u16,
7916 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
7917 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7918 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7919 pub flight_custom_version: [u8; 8],
7920 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
7921 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7922 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7923 pub middleware_custom_version: [u8; 8],
7924 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
7925 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7926 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7927 pub os_custom_version: [u8; 8],
7928 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
7929 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7930 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7931 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7932 pub uid2: [u8; 18],
7933}
7934impl AUTOPILOT_VERSION_DATA {
7935 pub const ENCODED_LEN: usize = 78usize;
7936 pub const DEFAULT: Self = Self {
7937 capabilities: MavProtocolCapability::DEFAULT,
7938 uid: 0_u64,
7939 flight_sw_version: 0_u32,
7940 middleware_sw_version: 0_u32,
7941 os_sw_version: 0_u32,
7942 board_version: 0_u32,
7943 vendor_id: 0_u16,
7944 product_id: 0_u16,
7945 flight_custom_version: [0_u8; 8usize],
7946 middleware_custom_version: [0_u8; 8usize],
7947 os_custom_version: [0_u8; 8usize],
7948 uid2: [0_u8; 18usize],
7949 };
7950 #[cfg(feature = "arbitrary")]
7951 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7952 use arbitrary::{Arbitrary, Unstructured};
7953 let mut buf = [0u8; 1024];
7954 rng.fill_bytes(&mut buf);
7955 let mut unstructured = Unstructured::new(&buf);
7956 Self::arbitrary(&mut unstructured).unwrap_or_default()
7957 }
7958}
7959impl Default for AUTOPILOT_VERSION_DATA {
7960 fn default() -> Self {
7961 Self::DEFAULT.clone()
7962 }
7963}
7964impl MessageData for AUTOPILOT_VERSION_DATA {
7965 type Message = MavMessage;
7966 const ID: u32 = 148u32;
7967 const NAME: &'static str = "AUTOPILOT_VERSION";
7968 const EXTRA_CRC: u8 = 178u8;
7969 const ENCODED_LEN: usize = 78usize;
7970 fn deser(
7971 _version: MavlinkVersion,
7972 __input: &[u8],
7973 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7974 let avail_len = __input.len();
7975 let mut payload_buf = [0; Self::ENCODED_LEN];
7976 let mut buf = if avail_len < Self::ENCODED_LEN {
7977 payload_buf[0..avail_len].copy_from_slice(__input);
7978 Bytes::new(&payload_buf)
7979 } else {
7980 Bytes::new(__input)
7981 };
7982 let mut __struct = Self::default();
7983 let tmp = buf.get_u64_le()?;
7984 __struct.capabilities = MavProtocolCapability::from_bits(
7985 tmp as <MavProtocolCapability as Flags>::Bits,
7986 )
7987 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7988 flag_type: "MavProtocolCapability",
7989 value: tmp as u64,
7990 })?;
7991 __struct.uid = buf.get_u64_le()?;
7992 __struct.flight_sw_version = buf.get_u32_le()?;
7993 __struct.middleware_sw_version = buf.get_u32_le()?;
7994 __struct.os_sw_version = buf.get_u32_le()?;
7995 __struct.board_version = buf.get_u32_le()?;
7996 __struct.vendor_id = buf.get_u16_le()?;
7997 __struct.product_id = buf.get_u16_le()?;
7998 for v in &mut __struct.flight_custom_version {
7999 let val = buf.get_u8()?;
8000 *v = val;
8001 }
8002 for v in &mut __struct.middleware_custom_version {
8003 let val = buf.get_u8()?;
8004 *v = val;
8005 }
8006 for v in &mut __struct.os_custom_version {
8007 let val = buf.get_u8()?;
8008 *v = val;
8009 }
8010 for v in &mut __struct.uid2 {
8011 let val = buf.get_u8()?;
8012 *v = val;
8013 }
8014 Ok(__struct)
8015 }
8016 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8017 let mut __tmp = BytesMut::new(bytes);
8018 #[allow(clippy::absurd_extreme_comparisons)]
8019 #[allow(unused_comparisons)]
8020 if __tmp.remaining() < Self::ENCODED_LEN {
8021 panic!(
8022 "buffer is too small (need {} bytes, but got {})",
8023 Self::ENCODED_LEN,
8024 __tmp.remaining(),
8025 )
8026 }
8027 __tmp.put_u64_le(self.capabilities.bits() as u64);
8028 __tmp.put_u64_le(self.uid);
8029 __tmp.put_u32_le(self.flight_sw_version);
8030 __tmp.put_u32_le(self.middleware_sw_version);
8031 __tmp.put_u32_le(self.os_sw_version);
8032 __tmp.put_u32_le(self.board_version);
8033 __tmp.put_u16_le(self.vendor_id);
8034 __tmp.put_u16_le(self.product_id);
8035 for val in &self.flight_custom_version {
8036 __tmp.put_u8(*val);
8037 }
8038 for val in &self.middleware_custom_version {
8039 __tmp.put_u8(*val);
8040 }
8041 for val in &self.os_custom_version {
8042 __tmp.put_u8(*val);
8043 }
8044 if matches!(version, MavlinkVersion::V2) {
8045 for val in &self.uid2 {
8046 __tmp.put_u8(*val);
8047 }
8048 let len = __tmp.len();
8049 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8050 } else {
8051 __tmp.len()
8052 }
8053 }
8054}
8055#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
8056#[doc = ""]
8057#[doc = "ID: 435"]
8058#[derive(Debug, Clone, PartialEq)]
8059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8060#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8061#[cfg_attr(feature = "ts", derive(TS))]
8062#[cfg_attr(feature = "ts", ts(export))]
8063pub struct AVAILABLE_MODES_DATA {
8064 #[doc = "A bitfield for use for autopilot-specific flags"]
8065 pub custom_mode: u32,
8066 #[doc = "Mode properties."]
8067 pub properties: MavModeProperty,
8068 #[doc = "The total number of available modes for the current vehicle type."]
8069 pub number_modes: u8,
8070 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
8071 pub mode_index: u8,
8072 #[doc = "Standard mode."]
8073 pub standard_mode: MavStandardMode,
8074 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
8075 #[cfg_attr(feature = "ts", ts(type = "string"))]
8076 pub mode_name: CharArray<35>,
8077}
8078impl AVAILABLE_MODES_DATA {
8079 pub const ENCODED_LEN: usize = 46usize;
8080 pub const DEFAULT: Self = Self {
8081 custom_mode: 0_u32,
8082 properties: MavModeProperty::DEFAULT,
8083 number_modes: 0_u8,
8084 mode_index: 0_u8,
8085 standard_mode: MavStandardMode::DEFAULT,
8086 mode_name: CharArray::new([0_u8; 35usize]),
8087 };
8088 #[cfg(feature = "arbitrary")]
8089 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8090 use arbitrary::{Arbitrary, Unstructured};
8091 let mut buf = [0u8; 1024];
8092 rng.fill_bytes(&mut buf);
8093 let mut unstructured = Unstructured::new(&buf);
8094 Self::arbitrary(&mut unstructured).unwrap_or_default()
8095 }
8096}
8097impl Default for AVAILABLE_MODES_DATA {
8098 fn default() -> Self {
8099 Self::DEFAULT.clone()
8100 }
8101}
8102impl MessageData for AVAILABLE_MODES_DATA {
8103 type Message = MavMessage;
8104 const ID: u32 = 435u32;
8105 const NAME: &'static str = "AVAILABLE_MODES";
8106 const EXTRA_CRC: u8 = 134u8;
8107 const ENCODED_LEN: usize = 46usize;
8108 fn deser(
8109 _version: MavlinkVersion,
8110 __input: &[u8],
8111 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8112 let avail_len = __input.len();
8113 let mut payload_buf = [0; Self::ENCODED_LEN];
8114 let mut buf = if avail_len < Self::ENCODED_LEN {
8115 payload_buf[0..avail_len].copy_from_slice(__input);
8116 Bytes::new(&payload_buf)
8117 } else {
8118 Bytes::new(__input)
8119 };
8120 let mut __struct = Self::default();
8121 __struct.custom_mode = buf.get_u32_le()?;
8122 let tmp = buf.get_u32_le()?;
8123 __struct.properties = MavModeProperty::from_bits(tmp as <MavModeProperty as Flags>::Bits)
8124 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8125 flag_type: "MavModeProperty",
8126 value: tmp as u64,
8127 })?;
8128 __struct.number_modes = buf.get_u8()?;
8129 __struct.mode_index = buf.get_u8()?;
8130 let tmp = buf.get_u8()?;
8131 __struct.standard_mode =
8132 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8133 enum_type: "MavStandardMode",
8134 value: tmp as u64,
8135 })?;
8136 let mut tmp = [0_u8; 35usize];
8137 for v in &mut tmp {
8138 *v = buf.get_u8()?;
8139 }
8140 __struct.mode_name = CharArray::new(tmp);
8141 Ok(__struct)
8142 }
8143 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8144 let mut __tmp = BytesMut::new(bytes);
8145 #[allow(clippy::absurd_extreme_comparisons)]
8146 #[allow(unused_comparisons)]
8147 if __tmp.remaining() < Self::ENCODED_LEN {
8148 panic!(
8149 "buffer is too small (need {} bytes, but got {})",
8150 Self::ENCODED_LEN,
8151 __tmp.remaining(),
8152 )
8153 }
8154 __tmp.put_u32_le(self.custom_mode);
8155 __tmp.put_u32_le(self.properties.bits() as u32);
8156 __tmp.put_u8(self.number_modes);
8157 __tmp.put_u8(self.mode_index);
8158 __tmp.put_u8(self.standard_mode as u8);
8159 for val in &self.mode_name {
8160 __tmp.put_u8(*val);
8161 }
8162 if matches!(version, MavlinkVersion::V2) {
8163 let len = __tmp.len();
8164 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8165 } else {
8166 __tmp.len()
8167 }
8168 }
8169}
8170#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
8171#[doc = ""]
8172#[doc = "ID: 437"]
8173#[derive(Debug, Clone, PartialEq)]
8174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8175#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8176#[cfg_attr(feature = "ts", derive(TS))]
8177#[cfg_attr(feature = "ts", ts(export))]
8178pub struct AVAILABLE_MODES_MONITOR_DATA {
8179 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
8180 pub seq: u8,
8181}
8182impl AVAILABLE_MODES_MONITOR_DATA {
8183 pub const ENCODED_LEN: usize = 1usize;
8184 pub const DEFAULT: Self = Self { seq: 0_u8 };
8185 #[cfg(feature = "arbitrary")]
8186 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8187 use arbitrary::{Arbitrary, Unstructured};
8188 let mut buf = [0u8; 1024];
8189 rng.fill_bytes(&mut buf);
8190 let mut unstructured = Unstructured::new(&buf);
8191 Self::arbitrary(&mut unstructured).unwrap_or_default()
8192 }
8193}
8194impl Default for AVAILABLE_MODES_MONITOR_DATA {
8195 fn default() -> Self {
8196 Self::DEFAULT.clone()
8197 }
8198}
8199impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
8200 type Message = MavMessage;
8201 const ID: u32 = 437u32;
8202 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
8203 const EXTRA_CRC: u8 = 30u8;
8204 const ENCODED_LEN: usize = 1usize;
8205 fn deser(
8206 _version: MavlinkVersion,
8207 __input: &[u8],
8208 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8209 let avail_len = __input.len();
8210 let mut payload_buf = [0; Self::ENCODED_LEN];
8211 let mut buf = if avail_len < Self::ENCODED_LEN {
8212 payload_buf[0..avail_len].copy_from_slice(__input);
8213 Bytes::new(&payload_buf)
8214 } else {
8215 Bytes::new(__input)
8216 };
8217 let mut __struct = Self::default();
8218 __struct.seq = buf.get_u8()?;
8219 Ok(__struct)
8220 }
8221 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8222 let mut __tmp = BytesMut::new(bytes);
8223 #[allow(clippy::absurd_extreme_comparisons)]
8224 #[allow(unused_comparisons)]
8225 if __tmp.remaining() < Self::ENCODED_LEN {
8226 panic!(
8227 "buffer is too small (need {} bytes, but got {})",
8228 Self::ENCODED_LEN,
8229 __tmp.remaining(),
8230 )
8231 }
8232 __tmp.put_u8(self.seq);
8233 if matches!(version, MavlinkVersion::V2) {
8234 let len = __tmp.len();
8235 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8236 } else {
8237 __tmp.len()
8238 }
8239 }
8240}
8241#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
8242#[doc = ""]
8243#[doc = "ID: 372"]
8244#[derive(Debug, Clone, PartialEq)]
8245#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8246#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8247#[cfg_attr(feature = "ts", derive(TS))]
8248#[cfg_attr(feature = "ts", ts(export))]
8249pub struct BATTERY_INFO_DATA {
8250 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
8251 pub discharge_minimum_voltage: f32,
8252 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
8253 pub charging_minimum_voltage: f32,
8254 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
8255 pub resting_minimum_voltage: f32,
8256 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
8257 pub charging_maximum_voltage: f32,
8258 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
8259 pub charging_maximum_current: f32,
8260 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
8261 pub nominal_voltage: f32,
8262 #[doc = "Maximum pack discharge current. 0: field not provided."]
8263 pub discharge_maximum_current: f32,
8264 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
8265 pub discharge_maximum_burst_current: f32,
8266 #[doc = "Fully charged design capacity. 0: field not provided."]
8267 pub design_capacity: f32,
8268 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
8269 pub full_charge_capacity: f32,
8270 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
8271 pub cycle_count: u16,
8272 #[doc = "Battery weight. 0: field not provided."]
8273 pub weight: u16,
8274 #[doc = "Battery ID"]
8275 pub id: u8,
8276 #[doc = "Function of the battery."]
8277 pub battery_function: MavBatteryFunction,
8278 #[doc = "Type (chemistry) of the battery."]
8279 pub mavtype: MavBatteryType,
8280 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
8281 pub state_of_health: u8,
8282 #[doc = "Number of battery cells in series. 0: field not provided."]
8283 pub cells_in_series: u8,
8284 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
8285 #[cfg_attr(feature = "ts", ts(type = "string"))]
8286 pub manufacture_date: CharArray<9>,
8287 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
8288 #[cfg_attr(feature = "ts", ts(type = "string"))]
8289 pub serial_number: CharArray<32>,
8290 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
8291 #[cfg_attr(feature = "ts", ts(type = "string"))]
8292 pub name: CharArray<50>,
8293}
8294impl BATTERY_INFO_DATA {
8295 pub const ENCODED_LEN: usize = 140usize;
8296 pub const DEFAULT: Self = Self {
8297 discharge_minimum_voltage: 0.0_f32,
8298 charging_minimum_voltage: 0.0_f32,
8299 resting_minimum_voltage: 0.0_f32,
8300 charging_maximum_voltage: 0.0_f32,
8301 charging_maximum_current: 0.0_f32,
8302 nominal_voltage: 0.0_f32,
8303 discharge_maximum_current: 0.0_f32,
8304 discharge_maximum_burst_current: 0.0_f32,
8305 design_capacity: 0.0_f32,
8306 full_charge_capacity: 0.0_f32,
8307 cycle_count: 0_u16,
8308 weight: 0_u16,
8309 id: 0_u8,
8310 battery_function: MavBatteryFunction::DEFAULT,
8311 mavtype: MavBatteryType::DEFAULT,
8312 state_of_health: 0_u8,
8313 cells_in_series: 0_u8,
8314 manufacture_date: CharArray::new([0_u8; 9usize]),
8315 serial_number: CharArray::new([0_u8; 32usize]),
8316 name: CharArray::new([0_u8; 50usize]),
8317 };
8318 #[cfg(feature = "arbitrary")]
8319 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8320 use arbitrary::{Arbitrary, Unstructured};
8321 let mut buf = [0u8; 1024];
8322 rng.fill_bytes(&mut buf);
8323 let mut unstructured = Unstructured::new(&buf);
8324 Self::arbitrary(&mut unstructured).unwrap_or_default()
8325 }
8326}
8327impl Default for BATTERY_INFO_DATA {
8328 fn default() -> Self {
8329 Self::DEFAULT.clone()
8330 }
8331}
8332impl MessageData for BATTERY_INFO_DATA {
8333 type Message = MavMessage;
8334 const ID: u32 = 372u32;
8335 const NAME: &'static str = "BATTERY_INFO";
8336 const EXTRA_CRC: u8 = 26u8;
8337 const ENCODED_LEN: usize = 140usize;
8338 fn deser(
8339 _version: MavlinkVersion,
8340 __input: &[u8],
8341 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8342 let avail_len = __input.len();
8343 let mut payload_buf = [0; Self::ENCODED_LEN];
8344 let mut buf = if avail_len < Self::ENCODED_LEN {
8345 payload_buf[0..avail_len].copy_from_slice(__input);
8346 Bytes::new(&payload_buf)
8347 } else {
8348 Bytes::new(__input)
8349 };
8350 let mut __struct = Self::default();
8351 __struct.discharge_minimum_voltage = buf.get_f32_le()?;
8352 __struct.charging_minimum_voltage = buf.get_f32_le()?;
8353 __struct.resting_minimum_voltage = buf.get_f32_le()?;
8354 __struct.charging_maximum_voltage = buf.get_f32_le()?;
8355 __struct.charging_maximum_current = buf.get_f32_le()?;
8356 __struct.nominal_voltage = buf.get_f32_le()?;
8357 __struct.discharge_maximum_current = buf.get_f32_le()?;
8358 __struct.discharge_maximum_burst_current = buf.get_f32_le()?;
8359 __struct.design_capacity = buf.get_f32_le()?;
8360 __struct.full_charge_capacity = buf.get_f32_le()?;
8361 __struct.cycle_count = buf.get_u16_le()?;
8362 __struct.weight = buf.get_u16_le()?;
8363 __struct.id = buf.get_u8()?;
8364 let tmp = buf.get_u8()?;
8365 __struct.battery_function =
8366 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8367 enum_type: "MavBatteryFunction",
8368 value: tmp as u64,
8369 })?;
8370 let tmp = buf.get_u8()?;
8371 __struct.mavtype =
8372 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8373 enum_type: "MavBatteryType",
8374 value: tmp as u64,
8375 })?;
8376 __struct.state_of_health = buf.get_u8()?;
8377 __struct.cells_in_series = buf.get_u8()?;
8378 let mut tmp = [0_u8; 9usize];
8379 for v in &mut tmp {
8380 *v = buf.get_u8()?;
8381 }
8382 __struct.manufacture_date = CharArray::new(tmp);
8383 let mut tmp = [0_u8; 32usize];
8384 for v in &mut tmp {
8385 *v = buf.get_u8()?;
8386 }
8387 __struct.serial_number = CharArray::new(tmp);
8388 let mut tmp = [0_u8; 50usize];
8389 for v in &mut tmp {
8390 *v = buf.get_u8()?;
8391 }
8392 __struct.name = CharArray::new(tmp);
8393 Ok(__struct)
8394 }
8395 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8396 let mut __tmp = BytesMut::new(bytes);
8397 #[allow(clippy::absurd_extreme_comparisons)]
8398 #[allow(unused_comparisons)]
8399 if __tmp.remaining() < Self::ENCODED_LEN {
8400 panic!(
8401 "buffer is too small (need {} bytes, but got {})",
8402 Self::ENCODED_LEN,
8403 __tmp.remaining(),
8404 )
8405 }
8406 __tmp.put_f32_le(self.discharge_minimum_voltage);
8407 __tmp.put_f32_le(self.charging_minimum_voltage);
8408 __tmp.put_f32_le(self.resting_minimum_voltage);
8409 __tmp.put_f32_le(self.charging_maximum_voltage);
8410 __tmp.put_f32_le(self.charging_maximum_current);
8411 __tmp.put_f32_le(self.nominal_voltage);
8412 __tmp.put_f32_le(self.discharge_maximum_current);
8413 __tmp.put_f32_le(self.discharge_maximum_burst_current);
8414 __tmp.put_f32_le(self.design_capacity);
8415 __tmp.put_f32_le(self.full_charge_capacity);
8416 __tmp.put_u16_le(self.cycle_count);
8417 __tmp.put_u16_le(self.weight);
8418 __tmp.put_u8(self.id);
8419 __tmp.put_u8(self.battery_function as u8);
8420 __tmp.put_u8(self.mavtype as u8);
8421 __tmp.put_u8(self.state_of_health);
8422 __tmp.put_u8(self.cells_in_series);
8423 for val in &self.manufacture_date {
8424 __tmp.put_u8(*val);
8425 }
8426 for val in &self.serial_number {
8427 __tmp.put_u8(*val);
8428 }
8429 for val in &self.name {
8430 __tmp.put_u8(*val);
8431 }
8432 if matches!(version, MavlinkVersion::V2) {
8433 let len = __tmp.len();
8434 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8435 } else {
8436 __tmp.len()
8437 }
8438 }
8439}
8440#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
8441#[doc = ""]
8442#[doc = "ID: 147"]
8443#[derive(Debug, Clone, PartialEq)]
8444#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8445#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8446#[cfg_attr(feature = "ts", derive(TS))]
8447#[cfg_attr(feature = "ts", ts(export))]
8448pub struct BATTERY_STATUS_DATA {
8449 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
8450 pub current_consumed: i32,
8451 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
8452 pub energy_consumed: i32,
8453 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
8454 pub temperature: i16,
8455 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
8456 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8457 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8458 pub voltages: [u16; 10],
8459 #[doc = "Battery current, -1: autopilot does not measure the current"]
8460 pub current_battery: i16,
8461 #[doc = "Battery ID"]
8462 pub id: u8,
8463 #[doc = "Function of the battery"]
8464 pub battery_function: MavBatteryFunction,
8465 #[doc = "Type (chemistry) of the battery"]
8466 pub mavtype: MavBatteryType,
8467 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
8468 pub battery_remaining: i8,
8469 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
8470 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8471 pub time_remaining: i32,
8472 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
8473 #[cfg_attr(feature = "serde", serde(default))]
8474 pub charge_state: MavBatteryChargeState,
8475 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
8476 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8477 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8478 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8479 pub voltages_ext: [u16; 4],
8480 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
8481 #[cfg_attr(feature = "serde", serde(default))]
8482 pub mode: MavBatteryMode,
8483 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
8484 #[cfg_attr(feature = "serde", serde(default))]
8485 pub fault_bitmask: MavBatteryFault,
8486}
8487impl BATTERY_STATUS_DATA {
8488 pub const ENCODED_LEN: usize = 54usize;
8489 pub const DEFAULT: Self = Self {
8490 current_consumed: 0_i32,
8491 energy_consumed: 0_i32,
8492 temperature: 0_i16,
8493 voltages: [0_u16; 10usize],
8494 current_battery: 0_i16,
8495 id: 0_u8,
8496 battery_function: MavBatteryFunction::DEFAULT,
8497 mavtype: MavBatteryType::DEFAULT,
8498 battery_remaining: 0_i8,
8499 time_remaining: 0_i32,
8500 charge_state: MavBatteryChargeState::DEFAULT,
8501 voltages_ext: [0_u16; 4usize],
8502 mode: MavBatteryMode::DEFAULT,
8503 fault_bitmask: MavBatteryFault::DEFAULT,
8504 };
8505 #[cfg(feature = "arbitrary")]
8506 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8507 use arbitrary::{Arbitrary, Unstructured};
8508 let mut buf = [0u8; 1024];
8509 rng.fill_bytes(&mut buf);
8510 let mut unstructured = Unstructured::new(&buf);
8511 Self::arbitrary(&mut unstructured).unwrap_or_default()
8512 }
8513}
8514impl Default for BATTERY_STATUS_DATA {
8515 fn default() -> Self {
8516 Self::DEFAULT.clone()
8517 }
8518}
8519impl MessageData for BATTERY_STATUS_DATA {
8520 type Message = MavMessage;
8521 const ID: u32 = 147u32;
8522 const NAME: &'static str = "BATTERY_STATUS";
8523 const EXTRA_CRC: u8 = 154u8;
8524 const ENCODED_LEN: usize = 54usize;
8525 fn deser(
8526 _version: MavlinkVersion,
8527 __input: &[u8],
8528 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8529 let avail_len = __input.len();
8530 let mut payload_buf = [0; Self::ENCODED_LEN];
8531 let mut buf = if avail_len < Self::ENCODED_LEN {
8532 payload_buf[0..avail_len].copy_from_slice(__input);
8533 Bytes::new(&payload_buf)
8534 } else {
8535 Bytes::new(__input)
8536 };
8537 let mut __struct = Self::default();
8538 __struct.current_consumed = buf.get_i32_le()?;
8539 __struct.energy_consumed = buf.get_i32_le()?;
8540 __struct.temperature = buf.get_i16_le()?;
8541 for v in &mut __struct.voltages {
8542 let val = buf.get_u16_le()?;
8543 *v = val;
8544 }
8545 __struct.current_battery = buf.get_i16_le()?;
8546 __struct.id = buf.get_u8()?;
8547 let tmp = buf.get_u8()?;
8548 __struct.battery_function =
8549 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8550 enum_type: "MavBatteryFunction",
8551 value: tmp as u64,
8552 })?;
8553 let tmp = buf.get_u8()?;
8554 __struct.mavtype =
8555 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8556 enum_type: "MavBatteryType",
8557 value: tmp as u64,
8558 })?;
8559 __struct.battery_remaining = buf.get_i8()?;
8560 __struct.time_remaining = buf.get_i32_le()?;
8561 let tmp = buf.get_u8()?;
8562 __struct.charge_state =
8563 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8564 enum_type: "MavBatteryChargeState",
8565 value: tmp as u64,
8566 })?;
8567 for v in &mut __struct.voltages_ext {
8568 let val = buf.get_u16_le()?;
8569 *v = val;
8570 }
8571 let tmp = buf.get_u8()?;
8572 __struct.mode =
8573 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8574 enum_type: "MavBatteryMode",
8575 value: tmp as u64,
8576 })?;
8577 let tmp = buf.get_u32_le()?;
8578 __struct.fault_bitmask = MavBatteryFault::from_bits(
8579 tmp as <MavBatteryFault as Flags>::Bits,
8580 )
8581 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8582 flag_type: "MavBatteryFault",
8583 value: tmp as u64,
8584 })?;
8585 Ok(__struct)
8586 }
8587 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8588 let mut __tmp = BytesMut::new(bytes);
8589 #[allow(clippy::absurd_extreme_comparisons)]
8590 #[allow(unused_comparisons)]
8591 if __tmp.remaining() < Self::ENCODED_LEN {
8592 panic!(
8593 "buffer is too small (need {} bytes, but got {})",
8594 Self::ENCODED_LEN,
8595 __tmp.remaining(),
8596 )
8597 }
8598 __tmp.put_i32_le(self.current_consumed);
8599 __tmp.put_i32_le(self.energy_consumed);
8600 __tmp.put_i16_le(self.temperature);
8601 for val in &self.voltages {
8602 __tmp.put_u16_le(*val);
8603 }
8604 __tmp.put_i16_le(self.current_battery);
8605 __tmp.put_u8(self.id);
8606 __tmp.put_u8(self.battery_function as u8);
8607 __tmp.put_u8(self.mavtype as u8);
8608 __tmp.put_i8(self.battery_remaining);
8609 if matches!(version, MavlinkVersion::V2) {
8610 __tmp.put_i32_le(self.time_remaining);
8611 __tmp.put_u8(self.charge_state as u8);
8612 for val in &self.voltages_ext {
8613 __tmp.put_u16_le(*val);
8614 }
8615 __tmp.put_u8(self.mode as u8);
8616 __tmp.put_u32_le(self.fault_bitmask.bits() as u32);
8617 let len = __tmp.len();
8618 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8619 } else {
8620 __tmp.len()
8621 }
8622 }
8623}
8624#[doc = "Report button state change."]
8625#[doc = ""]
8626#[doc = "ID: 257"]
8627#[derive(Debug, Clone, PartialEq)]
8628#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8629#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8630#[cfg_attr(feature = "ts", derive(TS))]
8631#[cfg_attr(feature = "ts", ts(export))]
8632pub struct BUTTON_CHANGE_DATA {
8633 #[doc = "Timestamp (time since system boot)."]
8634 pub time_boot_ms: u32,
8635 #[doc = "Time of last change of button state."]
8636 pub last_change_ms: u32,
8637 #[doc = "Bitmap for state of buttons."]
8638 pub state: u8,
8639}
8640impl BUTTON_CHANGE_DATA {
8641 pub const ENCODED_LEN: usize = 9usize;
8642 pub const DEFAULT: Self = Self {
8643 time_boot_ms: 0_u32,
8644 last_change_ms: 0_u32,
8645 state: 0_u8,
8646 };
8647 #[cfg(feature = "arbitrary")]
8648 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8649 use arbitrary::{Arbitrary, Unstructured};
8650 let mut buf = [0u8; 1024];
8651 rng.fill_bytes(&mut buf);
8652 let mut unstructured = Unstructured::new(&buf);
8653 Self::arbitrary(&mut unstructured).unwrap_or_default()
8654 }
8655}
8656impl Default for BUTTON_CHANGE_DATA {
8657 fn default() -> Self {
8658 Self::DEFAULT.clone()
8659 }
8660}
8661impl MessageData for BUTTON_CHANGE_DATA {
8662 type Message = MavMessage;
8663 const ID: u32 = 257u32;
8664 const NAME: &'static str = "BUTTON_CHANGE";
8665 const EXTRA_CRC: u8 = 131u8;
8666 const ENCODED_LEN: usize = 9usize;
8667 fn deser(
8668 _version: MavlinkVersion,
8669 __input: &[u8],
8670 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8671 let avail_len = __input.len();
8672 let mut payload_buf = [0; Self::ENCODED_LEN];
8673 let mut buf = if avail_len < Self::ENCODED_LEN {
8674 payload_buf[0..avail_len].copy_from_slice(__input);
8675 Bytes::new(&payload_buf)
8676 } else {
8677 Bytes::new(__input)
8678 };
8679 let mut __struct = Self::default();
8680 __struct.time_boot_ms = buf.get_u32_le()?;
8681 __struct.last_change_ms = buf.get_u32_le()?;
8682 __struct.state = buf.get_u8()?;
8683 Ok(__struct)
8684 }
8685 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8686 let mut __tmp = BytesMut::new(bytes);
8687 #[allow(clippy::absurd_extreme_comparisons)]
8688 #[allow(unused_comparisons)]
8689 if __tmp.remaining() < Self::ENCODED_LEN {
8690 panic!(
8691 "buffer is too small (need {} bytes, but got {})",
8692 Self::ENCODED_LEN,
8693 __tmp.remaining(),
8694 )
8695 }
8696 __tmp.put_u32_le(self.time_boot_ms);
8697 __tmp.put_u32_le(self.last_change_ms);
8698 __tmp.put_u8(self.state);
8699 if matches!(version, MavlinkVersion::V2) {
8700 let len = __tmp.len();
8701 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8702 } else {
8703 __tmp.len()
8704 }
8705 }
8706}
8707#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
8708#[doc = ""]
8709#[doc = "ID: 262"]
8710#[derive(Debug, Clone, PartialEq)]
8711#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8713#[cfg_attr(feature = "ts", derive(TS))]
8714#[cfg_attr(feature = "ts", ts(export))]
8715pub struct CAMERA_CAPTURE_STATUS_DATA {
8716 #[doc = "Timestamp (time since system boot)."]
8717 pub time_boot_ms: u32,
8718 #[doc = "Image capture interval"]
8719 pub image_interval: f32,
8720 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
8721 pub recording_time_ms: u32,
8722 #[doc = "Available storage capacity."]
8723 pub available_capacity: f32,
8724 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
8725 pub image_status: u8,
8726 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
8727 pub video_status: u8,
8728 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
8729 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8730 pub image_count: i32,
8731 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8732 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8733 pub camera_device_id: u8,
8734}
8735impl CAMERA_CAPTURE_STATUS_DATA {
8736 pub const ENCODED_LEN: usize = 23usize;
8737 pub const DEFAULT: Self = Self {
8738 time_boot_ms: 0_u32,
8739 image_interval: 0.0_f32,
8740 recording_time_ms: 0_u32,
8741 available_capacity: 0.0_f32,
8742 image_status: 0_u8,
8743 video_status: 0_u8,
8744 image_count: 0_i32,
8745 camera_device_id: 0_u8,
8746 };
8747 #[cfg(feature = "arbitrary")]
8748 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8749 use arbitrary::{Arbitrary, Unstructured};
8750 let mut buf = [0u8; 1024];
8751 rng.fill_bytes(&mut buf);
8752 let mut unstructured = Unstructured::new(&buf);
8753 Self::arbitrary(&mut unstructured).unwrap_or_default()
8754 }
8755}
8756impl Default for CAMERA_CAPTURE_STATUS_DATA {
8757 fn default() -> Self {
8758 Self::DEFAULT.clone()
8759 }
8760}
8761impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
8762 type Message = MavMessage;
8763 const ID: u32 = 262u32;
8764 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
8765 const EXTRA_CRC: u8 = 12u8;
8766 const ENCODED_LEN: usize = 23usize;
8767 fn deser(
8768 _version: MavlinkVersion,
8769 __input: &[u8],
8770 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8771 let avail_len = __input.len();
8772 let mut payload_buf = [0; Self::ENCODED_LEN];
8773 let mut buf = if avail_len < Self::ENCODED_LEN {
8774 payload_buf[0..avail_len].copy_from_slice(__input);
8775 Bytes::new(&payload_buf)
8776 } else {
8777 Bytes::new(__input)
8778 };
8779 let mut __struct = Self::default();
8780 __struct.time_boot_ms = buf.get_u32_le()?;
8781 __struct.image_interval = buf.get_f32_le()?;
8782 __struct.recording_time_ms = buf.get_u32_le()?;
8783 __struct.available_capacity = buf.get_f32_le()?;
8784 __struct.image_status = buf.get_u8()?;
8785 __struct.video_status = buf.get_u8()?;
8786 __struct.image_count = buf.get_i32_le()?;
8787 __struct.camera_device_id = buf.get_u8()?;
8788 Ok(__struct)
8789 }
8790 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8791 let mut __tmp = BytesMut::new(bytes);
8792 #[allow(clippy::absurd_extreme_comparisons)]
8793 #[allow(unused_comparisons)]
8794 if __tmp.remaining() < Self::ENCODED_LEN {
8795 panic!(
8796 "buffer is too small (need {} bytes, but got {})",
8797 Self::ENCODED_LEN,
8798 __tmp.remaining(),
8799 )
8800 }
8801 __tmp.put_u32_le(self.time_boot_ms);
8802 __tmp.put_f32_le(self.image_interval);
8803 __tmp.put_u32_le(self.recording_time_ms);
8804 __tmp.put_f32_le(self.available_capacity);
8805 __tmp.put_u8(self.image_status);
8806 __tmp.put_u8(self.video_status);
8807 if matches!(version, MavlinkVersion::V2) {
8808 __tmp.put_i32_le(self.image_count);
8809 __tmp.put_u8(self.camera_device_id);
8810 let len = __tmp.len();
8811 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8812 } else {
8813 __tmp.len()
8814 }
8815 }
8816}
8817#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
8818#[doc = ""]
8819#[doc = "ID: 271"]
8820#[derive(Debug, Clone, PartialEq)]
8821#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8822#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8823#[cfg_attr(feature = "ts", derive(TS))]
8824#[cfg_attr(feature = "ts", ts(export))]
8825pub struct CAMERA_FOV_STATUS_DATA {
8826 #[doc = "Timestamp (time since system boot)."]
8827 pub time_boot_ms: u32,
8828 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
8829 pub lat_camera: i32,
8830 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
8831 pub lon_camera: i32,
8832 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
8833 pub alt_camera: i32,
8834 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
8835 pub lat_image: i32,
8836 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
8837 pub lon_image: i32,
8838 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
8839 pub alt_image: i32,
8840 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
8841 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8842 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8843 pub q: [f32; 4],
8844 #[doc = "Horizontal field of view (NaN if unknown)."]
8845 pub hfov: f32,
8846 #[doc = "Vertical field of view (NaN if unknown)."]
8847 pub vfov: f32,
8848 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8849 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8850 pub camera_device_id: u8,
8851}
8852impl CAMERA_FOV_STATUS_DATA {
8853 pub const ENCODED_LEN: usize = 53usize;
8854 pub const DEFAULT: Self = Self {
8855 time_boot_ms: 0_u32,
8856 lat_camera: 0_i32,
8857 lon_camera: 0_i32,
8858 alt_camera: 0_i32,
8859 lat_image: 0_i32,
8860 lon_image: 0_i32,
8861 alt_image: 0_i32,
8862 q: [0.0_f32; 4usize],
8863 hfov: 0.0_f32,
8864 vfov: 0.0_f32,
8865 camera_device_id: 0_u8,
8866 };
8867 #[cfg(feature = "arbitrary")]
8868 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8869 use arbitrary::{Arbitrary, Unstructured};
8870 let mut buf = [0u8; 1024];
8871 rng.fill_bytes(&mut buf);
8872 let mut unstructured = Unstructured::new(&buf);
8873 Self::arbitrary(&mut unstructured).unwrap_or_default()
8874 }
8875}
8876impl Default for CAMERA_FOV_STATUS_DATA {
8877 fn default() -> Self {
8878 Self::DEFAULT.clone()
8879 }
8880}
8881impl MessageData for CAMERA_FOV_STATUS_DATA {
8882 type Message = MavMessage;
8883 const ID: u32 = 271u32;
8884 const NAME: &'static str = "CAMERA_FOV_STATUS";
8885 const EXTRA_CRC: u8 = 22u8;
8886 const ENCODED_LEN: usize = 53usize;
8887 fn deser(
8888 _version: MavlinkVersion,
8889 __input: &[u8],
8890 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8891 let avail_len = __input.len();
8892 let mut payload_buf = [0; Self::ENCODED_LEN];
8893 let mut buf = if avail_len < Self::ENCODED_LEN {
8894 payload_buf[0..avail_len].copy_from_slice(__input);
8895 Bytes::new(&payload_buf)
8896 } else {
8897 Bytes::new(__input)
8898 };
8899 let mut __struct = Self::default();
8900 __struct.time_boot_ms = buf.get_u32_le()?;
8901 __struct.lat_camera = buf.get_i32_le()?;
8902 __struct.lon_camera = buf.get_i32_le()?;
8903 __struct.alt_camera = buf.get_i32_le()?;
8904 __struct.lat_image = buf.get_i32_le()?;
8905 __struct.lon_image = buf.get_i32_le()?;
8906 __struct.alt_image = buf.get_i32_le()?;
8907 for v in &mut __struct.q {
8908 let val = buf.get_f32_le()?;
8909 *v = val;
8910 }
8911 __struct.hfov = buf.get_f32_le()?;
8912 __struct.vfov = buf.get_f32_le()?;
8913 __struct.camera_device_id = buf.get_u8()?;
8914 Ok(__struct)
8915 }
8916 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8917 let mut __tmp = BytesMut::new(bytes);
8918 #[allow(clippy::absurd_extreme_comparisons)]
8919 #[allow(unused_comparisons)]
8920 if __tmp.remaining() < Self::ENCODED_LEN {
8921 panic!(
8922 "buffer is too small (need {} bytes, but got {})",
8923 Self::ENCODED_LEN,
8924 __tmp.remaining(),
8925 )
8926 }
8927 __tmp.put_u32_le(self.time_boot_ms);
8928 __tmp.put_i32_le(self.lat_camera);
8929 __tmp.put_i32_le(self.lon_camera);
8930 __tmp.put_i32_le(self.alt_camera);
8931 __tmp.put_i32_le(self.lat_image);
8932 __tmp.put_i32_le(self.lon_image);
8933 __tmp.put_i32_le(self.alt_image);
8934 for val in &self.q {
8935 __tmp.put_f32_le(*val);
8936 }
8937 __tmp.put_f32_le(self.hfov);
8938 __tmp.put_f32_le(self.vfov);
8939 if matches!(version, MavlinkVersion::V2) {
8940 __tmp.put_u8(self.camera_device_id);
8941 let len = __tmp.len();
8942 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8943 } else {
8944 __tmp.len()
8945 }
8946 }
8947}
8948#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
8949#[doc = ""]
8950#[doc = "ID: 263"]
8951#[derive(Debug, Clone, PartialEq)]
8952#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8953#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8954#[cfg_attr(feature = "ts", derive(TS))]
8955#[cfg_attr(feature = "ts", ts(export))]
8956pub struct CAMERA_IMAGE_CAPTURED_DATA {
8957 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
8958 pub time_utc: u64,
8959 #[doc = "Timestamp (time since system boot)."]
8960 pub time_boot_ms: u32,
8961 #[doc = "Latitude where image was taken"]
8962 pub lat: i32,
8963 #[doc = "Longitude where capture was taken"]
8964 pub lon: i32,
8965 #[doc = "Altitude (MSL) where image was taken"]
8966 pub alt: i32,
8967 #[doc = "Altitude above ground"]
8968 pub relative_alt: i32,
8969 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
8970 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8971 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8972 pub q: [f32; 4],
8973 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
8974 pub image_index: i32,
8975 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
8976 pub camera_id: u8,
8977 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
8978 pub capture_result: i8,
8979 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
8980 #[cfg_attr(feature = "ts", ts(type = "string"))]
8981 pub file_url: CharArray<205>,
8982}
8983impl CAMERA_IMAGE_CAPTURED_DATA {
8984 pub const ENCODED_LEN: usize = 255usize;
8985 pub const DEFAULT: Self = Self {
8986 time_utc: 0_u64,
8987 time_boot_ms: 0_u32,
8988 lat: 0_i32,
8989 lon: 0_i32,
8990 alt: 0_i32,
8991 relative_alt: 0_i32,
8992 q: [0.0_f32; 4usize],
8993 image_index: 0_i32,
8994 camera_id: 0_u8,
8995 capture_result: 0_i8,
8996 file_url: CharArray::new([0_u8; 205usize]),
8997 };
8998 #[cfg(feature = "arbitrary")]
8999 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9000 use arbitrary::{Arbitrary, Unstructured};
9001 let mut buf = [0u8; 1024];
9002 rng.fill_bytes(&mut buf);
9003 let mut unstructured = Unstructured::new(&buf);
9004 Self::arbitrary(&mut unstructured).unwrap_or_default()
9005 }
9006}
9007impl Default for CAMERA_IMAGE_CAPTURED_DATA {
9008 fn default() -> Self {
9009 Self::DEFAULT.clone()
9010 }
9011}
9012impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
9013 type Message = MavMessage;
9014 const ID: u32 = 263u32;
9015 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
9016 const EXTRA_CRC: u8 = 133u8;
9017 const ENCODED_LEN: usize = 255usize;
9018 fn deser(
9019 _version: MavlinkVersion,
9020 __input: &[u8],
9021 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9022 let avail_len = __input.len();
9023 let mut payload_buf = [0; Self::ENCODED_LEN];
9024 let mut buf = if avail_len < Self::ENCODED_LEN {
9025 payload_buf[0..avail_len].copy_from_slice(__input);
9026 Bytes::new(&payload_buf)
9027 } else {
9028 Bytes::new(__input)
9029 };
9030 let mut __struct = Self::default();
9031 __struct.time_utc = buf.get_u64_le()?;
9032 __struct.time_boot_ms = buf.get_u32_le()?;
9033 __struct.lat = buf.get_i32_le()?;
9034 __struct.lon = buf.get_i32_le()?;
9035 __struct.alt = buf.get_i32_le()?;
9036 __struct.relative_alt = buf.get_i32_le()?;
9037 for v in &mut __struct.q {
9038 let val = buf.get_f32_le()?;
9039 *v = val;
9040 }
9041 __struct.image_index = buf.get_i32_le()?;
9042 __struct.camera_id = buf.get_u8()?;
9043 __struct.capture_result = buf.get_i8()?;
9044 let mut tmp = [0_u8; 205usize];
9045 for v in &mut tmp {
9046 *v = buf.get_u8()?;
9047 }
9048 __struct.file_url = CharArray::new(tmp);
9049 Ok(__struct)
9050 }
9051 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9052 let mut __tmp = BytesMut::new(bytes);
9053 #[allow(clippy::absurd_extreme_comparisons)]
9054 #[allow(unused_comparisons)]
9055 if __tmp.remaining() < Self::ENCODED_LEN {
9056 panic!(
9057 "buffer is too small (need {} bytes, but got {})",
9058 Self::ENCODED_LEN,
9059 __tmp.remaining(),
9060 )
9061 }
9062 __tmp.put_u64_le(self.time_utc);
9063 __tmp.put_u32_le(self.time_boot_ms);
9064 __tmp.put_i32_le(self.lat);
9065 __tmp.put_i32_le(self.lon);
9066 __tmp.put_i32_le(self.alt);
9067 __tmp.put_i32_le(self.relative_alt);
9068 for val in &self.q {
9069 __tmp.put_f32_le(*val);
9070 }
9071 __tmp.put_i32_le(self.image_index);
9072 __tmp.put_u8(self.camera_id);
9073 __tmp.put_i8(self.capture_result);
9074 for val in &self.file_url {
9075 __tmp.put_u8(*val);
9076 }
9077 if matches!(version, MavlinkVersion::V2) {
9078 let len = __tmp.len();
9079 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9080 } else {
9081 __tmp.len()
9082 }
9083 }
9084}
9085#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
9086#[doc = ""]
9087#[doc = "ID: 259"]
9088#[derive(Debug, Clone, PartialEq)]
9089#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9090#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9091#[cfg_attr(feature = "ts", derive(TS))]
9092#[cfg_attr(feature = "ts", ts(export))]
9093pub struct CAMERA_INFORMATION_DATA {
9094 #[doc = "Timestamp (time since system boot)."]
9095 pub time_boot_ms: u32,
9096 #[doc = "Version of the camera firmware, encoded as: (Dev&0xff)<<24 | (Patch&0xff)<<16 | (Minor&0xff)<<8 | (Major&0xff). Use 0 if not known."]
9097 pub firmware_version: u32,
9098 #[doc = "Focal length. Use NaN if not known."]
9099 pub focal_length: f32,
9100 #[doc = "Image sensor size horizontal. Use NaN if not known."]
9101 pub sensor_size_h: f32,
9102 #[doc = "Image sensor size vertical. Use NaN if not known."]
9103 pub sensor_size_v: f32,
9104 #[doc = "Bitmap of camera capability flags."]
9105 pub flags: CameraCapFlags,
9106 #[doc = "Horizontal image resolution. Use 0 if not known."]
9107 pub resolution_h: u16,
9108 #[doc = "Vertical image resolution. Use 0 if not known."]
9109 pub resolution_v: u16,
9110 #[doc = "Camera definition version (iteration). Use 0 if not known."]
9111 pub cam_definition_version: u16,
9112 #[doc = "Name of the camera vendor"]
9113 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9114 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9115 pub vendor_name: [u8; 32],
9116 #[doc = "Name of the camera model"]
9117 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9118 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9119 pub model_name: [u8; 32],
9120 #[doc = "Reserved for a lens ID. Use 0 if not known."]
9121 pub lens_id: u8,
9122 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
9123 #[cfg_attr(feature = "ts", ts(type = "string"))]
9124 pub cam_definition_uri: CharArray<140>,
9125 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
9126 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9127 pub gimbal_device_id: u8,
9128 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
9129 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9130 pub camera_device_id: u8,
9131}
9132impl CAMERA_INFORMATION_DATA {
9133 pub const ENCODED_LEN: usize = 237usize;
9134 pub const DEFAULT: Self = Self {
9135 time_boot_ms: 0_u32,
9136 firmware_version: 0_u32,
9137 focal_length: 0.0_f32,
9138 sensor_size_h: 0.0_f32,
9139 sensor_size_v: 0.0_f32,
9140 flags: CameraCapFlags::DEFAULT,
9141 resolution_h: 0_u16,
9142 resolution_v: 0_u16,
9143 cam_definition_version: 0_u16,
9144 vendor_name: [0_u8; 32usize],
9145 model_name: [0_u8; 32usize],
9146 lens_id: 0_u8,
9147 cam_definition_uri: CharArray::new([0_u8; 140usize]),
9148 gimbal_device_id: 0_u8,
9149 camera_device_id: 0_u8,
9150 };
9151 #[cfg(feature = "arbitrary")]
9152 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9153 use arbitrary::{Arbitrary, Unstructured};
9154 let mut buf = [0u8; 1024];
9155 rng.fill_bytes(&mut buf);
9156 let mut unstructured = Unstructured::new(&buf);
9157 Self::arbitrary(&mut unstructured).unwrap_or_default()
9158 }
9159}
9160impl Default for CAMERA_INFORMATION_DATA {
9161 fn default() -> Self {
9162 Self::DEFAULT.clone()
9163 }
9164}
9165impl MessageData for CAMERA_INFORMATION_DATA {
9166 type Message = MavMessage;
9167 const ID: u32 = 259u32;
9168 const NAME: &'static str = "CAMERA_INFORMATION";
9169 const EXTRA_CRC: u8 = 92u8;
9170 const ENCODED_LEN: usize = 237usize;
9171 fn deser(
9172 _version: MavlinkVersion,
9173 __input: &[u8],
9174 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9175 let avail_len = __input.len();
9176 let mut payload_buf = [0; Self::ENCODED_LEN];
9177 let mut buf = if avail_len < Self::ENCODED_LEN {
9178 payload_buf[0..avail_len].copy_from_slice(__input);
9179 Bytes::new(&payload_buf)
9180 } else {
9181 Bytes::new(__input)
9182 };
9183 let mut __struct = Self::default();
9184 __struct.time_boot_ms = buf.get_u32_le()?;
9185 __struct.firmware_version = buf.get_u32_le()?;
9186 __struct.focal_length = buf.get_f32_le()?;
9187 __struct.sensor_size_h = buf.get_f32_le()?;
9188 __struct.sensor_size_v = buf.get_f32_le()?;
9189 let tmp = buf.get_u32_le()?;
9190 __struct.flags = CameraCapFlags::from_bits(tmp as <CameraCapFlags as Flags>::Bits).ok_or(
9191 ::mavlink_core::error::ParserError::InvalidFlag {
9192 flag_type: "CameraCapFlags",
9193 value: tmp as u64,
9194 },
9195 )?;
9196 __struct.resolution_h = buf.get_u16_le()?;
9197 __struct.resolution_v = buf.get_u16_le()?;
9198 __struct.cam_definition_version = buf.get_u16_le()?;
9199 for v in &mut __struct.vendor_name {
9200 let val = buf.get_u8()?;
9201 *v = val;
9202 }
9203 for v in &mut __struct.model_name {
9204 let val = buf.get_u8()?;
9205 *v = val;
9206 }
9207 __struct.lens_id = buf.get_u8()?;
9208 let mut tmp = [0_u8; 140usize];
9209 for v in &mut tmp {
9210 *v = buf.get_u8()?;
9211 }
9212 __struct.cam_definition_uri = CharArray::new(tmp);
9213 __struct.gimbal_device_id = buf.get_u8()?;
9214 __struct.camera_device_id = buf.get_u8()?;
9215 Ok(__struct)
9216 }
9217 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9218 let mut __tmp = BytesMut::new(bytes);
9219 #[allow(clippy::absurd_extreme_comparisons)]
9220 #[allow(unused_comparisons)]
9221 if __tmp.remaining() < Self::ENCODED_LEN {
9222 panic!(
9223 "buffer is too small (need {} bytes, but got {})",
9224 Self::ENCODED_LEN,
9225 __tmp.remaining(),
9226 )
9227 }
9228 __tmp.put_u32_le(self.time_boot_ms);
9229 __tmp.put_u32_le(self.firmware_version);
9230 __tmp.put_f32_le(self.focal_length);
9231 __tmp.put_f32_le(self.sensor_size_h);
9232 __tmp.put_f32_le(self.sensor_size_v);
9233 __tmp.put_u32_le(self.flags.bits() as u32);
9234 __tmp.put_u16_le(self.resolution_h);
9235 __tmp.put_u16_le(self.resolution_v);
9236 __tmp.put_u16_le(self.cam_definition_version);
9237 for val in &self.vendor_name {
9238 __tmp.put_u8(*val);
9239 }
9240 for val in &self.model_name {
9241 __tmp.put_u8(*val);
9242 }
9243 __tmp.put_u8(self.lens_id);
9244 for val in &self.cam_definition_uri {
9245 __tmp.put_u8(*val);
9246 }
9247 if matches!(version, MavlinkVersion::V2) {
9248 __tmp.put_u8(self.gimbal_device_id);
9249 __tmp.put_u8(self.camera_device_id);
9250 let len = __tmp.len();
9251 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9252 } else {
9253 __tmp.len()
9254 }
9255 }
9256}
9257#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
9258#[doc = ""]
9259#[doc = "ID: 260"]
9260#[derive(Debug, Clone, PartialEq)]
9261#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9262#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9263#[cfg_attr(feature = "ts", derive(TS))]
9264#[cfg_attr(feature = "ts", ts(export))]
9265pub struct CAMERA_SETTINGS_DATA {
9266 #[doc = "Timestamp (time since system boot)."]
9267 pub time_boot_ms: u32,
9268 #[doc = "Camera mode"]
9269 pub mode_id: CameraMode,
9270 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
9271 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9272 pub zoomLevel: f32,
9273 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
9274 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9275 pub focusLevel: f32,
9276 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
9277 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9278 pub camera_device_id: u8,
9279}
9280impl CAMERA_SETTINGS_DATA {
9281 pub const ENCODED_LEN: usize = 14usize;
9282 pub const DEFAULT: Self = Self {
9283 time_boot_ms: 0_u32,
9284 mode_id: CameraMode::DEFAULT,
9285 zoomLevel: 0.0_f32,
9286 focusLevel: 0.0_f32,
9287 camera_device_id: 0_u8,
9288 };
9289 #[cfg(feature = "arbitrary")]
9290 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9291 use arbitrary::{Arbitrary, Unstructured};
9292 let mut buf = [0u8; 1024];
9293 rng.fill_bytes(&mut buf);
9294 let mut unstructured = Unstructured::new(&buf);
9295 Self::arbitrary(&mut unstructured).unwrap_or_default()
9296 }
9297}
9298impl Default for CAMERA_SETTINGS_DATA {
9299 fn default() -> Self {
9300 Self::DEFAULT.clone()
9301 }
9302}
9303impl MessageData for CAMERA_SETTINGS_DATA {
9304 type Message = MavMessage;
9305 const ID: u32 = 260u32;
9306 const NAME: &'static str = "CAMERA_SETTINGS";
9307 const EXTRA_CRC: u8 = 146u8;
9308 const ENCODED_LEN: usize = 14usize;
9309 fn deser(
9310 _version: MavlinkVersion,
9311 __input: &[u8],
9312 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9313 let avail_len = __input.len();
9314 let mut payload_buf = [0; Self::ENCODED_LEN];
9315 let mut buf = if avail_len < Self::ENCODED_LEN {
9316 payload_buf[0..avail_len].copy_from_slice(__input);
9317 Bytes::new(&payload_buf)
9318 } else {
9319 Bytes::new(__input)
9320 };
9321 let mut __struct = Self::default();
9322 __struct.time_boot_ms = buf.get_u32_le()?;
9323 let tmp = buf.get_u8()?;
9324 __struct.mode_id =
9325 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9326 enum_type: "CameraMode",
9327 value: tmp as u64,
9328 })?;
9329 __struct.zoomLevel = buf.get_f32_le()?;
9330 __struct.focusLevel = buf.get_f32_le()?;
9331 __struct.camera_device_id = buf.get_u8()?;
9332 Ok(__struct)
9333 }
9334 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9335 let mut __tmp = BytesMut::new(bytes);
9336 #[allow(clippy::absurd_extreme_comparisons)]
9337 #[allow(unused_comparisons)]
9338 if __tmp.remaining() < Self::ENCODED_LEN {
9339 panic!(
9340 "buffer is too small (need {} bytes, but got {})",
9341 Self::ENCODED_LEN,
9342 __tmp.remaining(),
9343 )
9344 }
9345 __tmp.put_u32_le(self.time_boot_ms);
9346 __tmp.put_u8(self.mode_id as u8);
9347 if matches!(version, MavlinkVersion::V2) {
9348 __tmp.put_f32_le(self.zoomLevel);
9349 __tmp.put_f32_le(self.focusLevel);
9350 __tmp.put_u8(self.camera_device_id);
9351 let len = __tmp.len();
9352 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9353 } else {
9354 __tmp.len()
9355 }
9356 }
9357}
9358#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
9359#[doc = ""]
9360#[doc = "ID: 277"]
9361#[derive(Debug, Clone, PartialEq)]
9362#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9363#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9364#[cfg_attr(feature = "ts", derive(TS))]
9365#[cfg_attr(feature = "ts", ts(export))]
9366pub struct CAMERA_THERMAL_RANGE_DATA {
9367 #[doc = "Timestamp (time since system boot)."]
9368 pub time_boot_ms: u32,
9369 #[doc = "Temperature max."]
9370 pub max: f32,
9371 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
9372 pub max_point_x: f32,
9373 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
9374 pub max_point_y: f32,
9375 #[doc = "Temperature min."]
9376 pub min: f32,
9377 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
9378 pub min_point_x: f32,
9379 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
9380 pub min_point_y: f32,
9381 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
9382 pub stream_id: u8,
9383 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
9384 pub camera_device_id: u8,
9385}
9386impl CAMERA_THERMAL_RANGE_DATA {
9387 pub const ENCODED_LEN: usize = 30usize;
9388 pub const DEFAULT: Self = Self {
9389 time_boot_ms: 0_u32,
9390 max: 0.0_f32,
9391 max_point_x: 0.0_f32,
9392 max_point_y: 0.0_f32,
9393 min: 0.0_f32,
9394 min_point_x: 0.0_f32,
9395 min_point_y: 0.0_f32,
9396 stream_id: 0_u8,
9397 camera_device_id: 0_u8,
9398 };
9399 #[cfg(feature = "arbitrary")]
9400 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9401 use arbitrary::{Arbitrary, Unstructured};
9402 let mut buf = [0u8; 1024];
9403 rng.fill_bytes(&mut buf);
9404 let mut unstructured = Unstructured::new(&buf);
9405 Self::arbitrary(&mut unstructured).unwrap_or_default()
9406 }
9407}
9408impl Default for CAMERA_THERMAL_RANGE_DATA {
9409 fn default() -> Self {
9410 Self::DEFAULT.clone()
9411 }
9412}
9413impl MessageData for CAMERA_THERMAL_RANGE_DATA {
9414 type Message = MavMessage;
9415 const ID: u32 = 277u32;
9416 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
9417 const EXTRA_CRC: u8 = 62u8;
9418 const ENCODED_LEN: usize = 30usize;
9419 fn deser(
9420 _version: MavlinkVersion,
9421 __input: &[u8],
9422 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9423 let avail_len = __input.len();
9424 let mut payload_buf = [0; Self::ENCODED_LEN];
9425 let mut buf = if avail_len < Self::ENCODED_LEN {
9426 payload_buf[0..avail_len].copy_from_slice(__input);
9427 Bytes::new(&payload_buf)
9428 } else {
9429 Bytes::new(__input)
9430 };
9431 let mut __struct = Self::default();
9432 __struct.time_boot_ms = buf.get_u32_le()?;
9433 __struct.max = buf.get_f32_le()?;
9434 __struct.max_point_x = buf.get_f32_le()?;
9435 __struct.max_point_y = buf.get_f32_le()?;
9436 __struct.min = buf.get_f32_le()?;
9437 __struct.min_point_x = buf.get_f32_le()?;
9438 __struct.min_point_y = buf.get_f32_le()?;
9439 __struct.stream_id = buf.get_u8()?;
9440 __struct.camera_device_id = buf.get_u8()?;
9441 Ok(__struct)
9442 }
9443 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9444 let mut __tmp = BytesMut::new(bytes);
9445 #[allow(clippy::absurd_extreme_comparisons)]
9446 #[allow(unused_comparisons)]
9447 if __tmp.remaining() < Self::ENCODED_LEN {
9448 panic!(
9449 "buffer is too small (need {} bytes, but got {})",
9450 Self::ENCODED_LEN,
9451 __tmp.remaining(),
9452 )
9453 }
9454 __tmp.put_u32_le(self.time_boot_ms);
9455 __tmp.put_f32_le(self.max);
9456 __tmp.put_f32_le(self.max_point_x);
9457 __tmp.put_f32_le(self.max_point_y);
9458 __tmp.put_f32_le(self.min);
9459 __tmp.put_f32_le(self.min_point_x);
9460 __tmp.put_f32_le(self.min_point_y);
9461 __tmp.put_u8(self.stream_id);
9462 __tmp.put_u8(self.camera_device_id);
9463 if matches!(version, MavlinkVersion::V2) {
9464 let len = __tmp.len();
9465 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9466 } else {
9467 __tmp.len()
9468 }
9469 }
9470}
9471#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
9472#[doc = ""]
9473#[doc = "ID: 276"]
9474#[derive(Debug, Clone, PartialEq)]
9475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9476#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9477#[cfg_attr(feature = "ts", derive(TS))]
9478#[cfg_attr(feature = "ts", ts(export))]
9479pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
9480 #[doc = "Latitude of tracked object"]
9481 pub lat: i32,
9482 #[doc = "Longitude of tracked object"]
9483 pub lon: i32,
9484 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
9485 pub alt: f32,
9486 #[doc = "Horizontal accuracy. NAN if unknown"]
9487 pub h_acc: f32,
9488 #[doc = "Vertical accuracy. NAN if unknown"]
9489 pub v_acc: f32,
9490 #[doc = "North velocity of tracked object. NAN if unknown"]
9491 pub vel_n: f32,
9492 #[doc = "East velocity of tracked object. NAN if unknown"]
9493 pub vel_e: f32,
9494 #[doc = "Down velocity of tracked object. NAN if unknown"]
9495 pub vel_d: f32,
9496 #[doc = "Velocity accuracy. NAN if unknown"]
9497 pub vel_acc: f32,
9498 #[doc = "Distance between camera and tracked object. NAN if unknown"]
9499 pub dist: f32,
9500 #[doc = "Heading in radians, in NED. NAN if unknown"]
9501 pub hdg: f32,
9502 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
9503 pub hdg_acc: f32,
9504 #[doc = "Current tracking status"]
9505 pub tracking_status: CameraTrackingStatusFlags,
9506 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
9507 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9508 pub camera_device_id: u8,
9509}
9510impl CAMERA_TRACKING_GEO_STATUS_DATA {
9511 pub const ENCODED_LEN: usize = 50usize;
9512 pub const DEFAULT: Self = Self {
9513 lat: 0_i32,
9514 lon: 0_i32,
9515 alt: 0.0_f32,
9516 h_acc: 0.0_f32,
9517 v_acc: 0.0_f32,
9518 vel_n: 0.0_f32,
9519 vel_e: 0.0_f32,
9520 vel_d: 0.0_f32,
9521 vel_acc: 0.0_f32,
9522 dist: 0.0_f32,
9523 hdg: 0.0_f32,
9524 hdg_acc: 0.0_f32,
9525 tracking_status: CameraTrackingStatusFlags::DEFAULT,
9526 camera_device_id: 0_u8,
9527 };
9528 #[cfg(feature = "arbitrary")]
9529 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9530 use arbitrary::{Arbitrary, Unstructured};
9531 let mut buf = [0u8; 1024];
9532 rng.fill_bytes(&mut buf);
9533 let mut unstructured = Unstructured::new(&buf);
9534 Self::arbitrary(&mut unstructured).unwrap_or_default()
9535 }
9536}
9537impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
9538 fn default() -> Self {
9539 Self::DEFAULT.clone()
9540 }
9541}
9542impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
9543 type Message = MavMessage;
9544 const ID: u32 = 276u32;
9545 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
9546 const EXTRA_CRC: u8 = 18u8;
9547 const ENCODED_LEN: usize = 50usize;
9548 fn deser(
9549 _version: MavlinkVersion,
9550 __input: &[u8],
9551 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9552 let avail_len = __input.len();
9553 let mut payload_buf = [0; Self::ENCODED_LEN];
9554 let mut buf = if avail_len < Self::ENCODED_LEN {
9555 payload_buf[0..avail_len].copy_from_slice(__input);
9556 Bytes::new(&payload_buf)
9557 } else {
9558 Bytes::new(__input)
9559 };
9560 let mut __struct = Self::default();
9561 __struct.lat = buf.get_i32_le()?;
9562 __struct.lon = buf.get_i32_le()?;
9563 __struct.alt = buf.get_f32_le()?;
9564 __struct.h_acc = buf.get_f32_le()?;
9565 __struct.v_acc = buf.get_f32_le()?;
9566 __struct.vel_n = buf.get_f32_le()?;
9567 __struct.vel_e = buf.get_f32_le()?;
9568 __struct.vel_d = buf.get_f32_le()?;
9569 __struct.vel_acc = buf.get_f32_le()?;
9570 __struct.dist = buf.get_f32_le()?;
9571 __struct.hdg = buf.get_f32_le()?;
9572 __struct.hdg_acc = buf.get_f32_le()?;
9573 let tmp = buf.get_u8()?;
9574 __struct.tracking_status =
9575 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9576 enum_type: "CameraTrackingStatusFlags",
9577 value: tmp as u64,
9578 })?;
9579 __struct.camera_device_id = buf.get_u8()?;
9580 Ok(__struct)
9581 }
9582 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9583 let mut __tmp = BytesMut::new(bytes);
9584 #[allow(clippy::absurd_extreme_comparisons)]
9585 #[allow(unused_comparisons)]
9586 if __tmp.remaining() < Self::ENCODED_LEN {
9587 panic!(
9588 "buffer is too small (need {} bytes, but got {})",
9589 Self::ENCODED_LEN,
9590 __tmp.remaining(),
9591 )
9592 }
9593 __tmp.put_i32_le(self.lat);
9594 __tmp.put_i32_le(self.lon);
9595 __tmp.put_f32_le(self.alt);
9596 __tmp.put_f32_le(self.h_acc);
9597 __tmp.put_f32_le(self.v_acc);
9598 __tmp.put_f32_le(self.vel_n);
9599 __tmp.put_f32_le(self.vel_e);
9600 __tmp.put_f32_le(self.vel_d);
9601 __tmp.put_f32_le(self.vel_acc);
9602 __tmp.put_f32_le(self.dist);
9603 __tmp.put_f32_le(self.hdg);
9604 __tmp.put_f32_le(self.hdg_acc);
9605 __tmp.put_u8(self.tracking_status as u8);
9606 if matches!(version, MavlinkVersion::V2) {
9607 __tmp.put_u8(self.camera_device_id);
9608 let len = __tmp.len();
9609 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9610 } else {
9611 __tmp.len()
9612 }
9613 }
9614}
9615#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
9616#[doc = ""]
9617#[doc = "ID: 275"]
9618#[derive(Debug, Clone, PartialEq)]
9619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9620#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9621#[cfg_attr(feature = "ts", derive(TS))]
9622#[cfg_attr(feature = "ts", ts(export))]
9623pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
9624 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
9625 pub point_x: f32,
9626 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
9627 pub point_y: f32,
9628 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
9629 pub radius: f32,
9630 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
9631 pub rec_top_x: f32,
9632 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
9633 pub rec_top_y: f32,
9634 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
9635 pub rec_bottom_x: f32,
9636 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
9637 pub rec_bottom_y: f32,
9638 #[doc = "Current tracking status"]
9639 pub tracking_status: CameraTrackingStatusFlags,
9640 #[doc = "Current tracking mode"]
9641 pub tracking_mode: CameraTrackingMode,
9642 #[doc = "Defines location of target data"]
9643 pub target_data: CameraTrackingTargetData,
9644 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
9645 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9646 pub camera_device_id: u8,
9647}
9648impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
9649 pub const ENCODED_LEN: usize = 32usize;
9650 pub const DEFAULT: Self = Self {
9651 point_x: 0.0_f32,
9652 point_y: 0.0_f32,
9653 radius: 0.0_f32,
9654 rec_top_x: 0.0_f32,
9655 rec_top_y: 0.0_f32,
9656 rec_bottom_x: 0.0_f32,
9657 rec_bottom_y: 0.0_f32,
9658 tracking_status: CameraTrackingStatusFlags::DEFAULT,
9659 tracking_mode: CameraTrackingMode::DEFAULT,
9660 target_data: CameraTrackingTargetData::DEFAULT,
9661 camera_device_id: 0_u8,
9662 };
9663 #[cfg(feature = "arbitrary")]
9664 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9665 use arbitrary::{Arbitrary, Unstructured};
9666 let mut buf = [0u8; 1024];
9667 rng.fill_bytes(&mut buf);
9668 let mut unstructured = Unstructured::new(&buf);
9669 Self::arbitrary(&mut unstructured).unwrap_or_default()
9670 }
9671}
9672impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
9673 fn default() -> Self {
9674 Self::DEFAULT.clone()
9675 }
9676}
9677impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
9678 type Message = MavMessage;
9679 const ID: u32 = 275u32;
9680 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
9681 const EXTRA_CRC: u8 = 126u8;
9682 const ENCODED_LEN: usize = 32usize;
9683 fn deser(
9684 _version: MavlinkVersion,
9685 __input: &[u8],
9686 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9687 let avail_len = __input.len();
9688 let mut payload_buf = [0; Self::ENCODED_LEN];
9689 let mut buf = if avail_len < Self::ENCODED_LEN {
9690 payload_buf[0..avail_len].copy_from_slice(__input);
9691 Bytes::new(&payload_buf)
9692 } else {
9693 Bytes::new(__input)
9694 };
9695 let mut __struct = Self::default();
9696 __struct.point_x = buf.get_f32_le()?;
9697 __struct.point_y = buf.get_f32_le()?;
9698 __struct.radius = buf.get_f32_le()?;
9699 __struct.rec_top_x = buf.get_f32_le()?;
9700 __struct.rec_top_y = buf.get_f32_le()?;
9701 __struct.rec_bottom_x = buf.get_f32_le()?;
9702 __struct.rec_bottom_y = buf.get_f32_le()?;
9703 let tmp = buf.get_u8()?;
9704 __struct.tracking_status =
9705 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9706 enum_type: "CameraTrackingStatusFlags",
9707 value: tmp as u64,
9708 })?;
9709 let tmp = buf.get_u8()?;
9710 __struct.tracking_mode =
9711 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9712 enum_type: "CameraTrackingMode",
9713 value: tmp as u64,
9714 })?;
9715 let tmp = buf.get_u8()?;
9716 __struct.target_data =
9717 CameraTrackingTargetData::from_bits(tmp as <CameraTrackingTargetData as Flags>::Bits)
9718 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9719 flag_type: "CameraTrackingTargetData",
9720 value: tmp as u64,
9721 })?;
9722 __struct.camera_device_id = buf.get_u8()?;
9723 Ok(__struct)
9724 }
9725 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9726 let mut __tmp = BytesMut::new(bytes);
9727 #[allow(clippy::absurd_extreme_comparisons)]
9728 #[allow(unused_comparisons)]
9729 if __tmp.remaining() < Self::ENCODED_LEN {
9730 panic!(
9731 "buffer is too small (need {} bytes, but got {})",
9732 Self::ENCODED_LEN,
9733 __tmp.remaining(),
9734 )
9735 }
9736 __tmp.put_f32_le(self.point_x);
9737 __tmp.put_f32_le(self.point_y);
9738 __tmp.put_f32_le(self.radius);
9739 __tmp.put_f32_le(self.rec_top_x);
9740 __tmp.put_f32_le(self.rec_top_y);
9741 __tmp.put_f32_le(self.rec_bottom_x);
9742 __tmp.put_f32_le(self.rec_bottom_y);
9743 __tmp.put_u8(self.tracking_status as u8);
9744 __tmp.put_u8(self.tracking_mode as u8);
9745 __tmp.put_u8(self.target_data.bits() as u8);
9746 if matches!(version, MavlinkVersion::V2) {
9747 __tmp.put_u8(self.camera_device_id);
9748 let len = __tmp.len();
9749 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9750 } else {
9751 __tmp.len()
9752 }
9753 }
9754}
9755#[doc = "Camera-IMU triggering and synchronisation message."]
9756#[doc = ""]
9757#[doc = "ID: 112"]
9758#[derive(Debug, Clone, PartialEq)]
9759#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9761#[cfg_attr(feature = "ts", derive(TS))]
9762#[cfg_attr(feature = "ts", ts(export))]
9763pub struct CAMERA_TRIGGER_DATA {
9764 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9765 pub time_usec: u64,
9766 #[doc = "Image frame sequence"]
9767 pub seq: u32,
9768}
9769impl CAMERA_TRIGGER_DATA {
9770 pub const ENCODED_LEN: usize = 12usize;
9771 pub const DEFAULT: Self = Self {
9772 time_usec: 0_u64,
9773 seq: 0_u32,
9774 };
9775 #[cfg(feature = "arbitrary")]
9776 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9777 use arbitrary::{Arbitrary, Unstructured};
9778 let mut buf = [0u8; 1024];
9779 rng.fill_bytes(&mut buf);
9780 let mut unstructured = Unstructured::new(&buf);
9781 Self::arbitrary(&mut unstructured).unwrap_or_default()
9782 }
9783}
9784impl Default for CAMERA_TRIGGER_DATA {
9785 fn default() -> Self {
9786 Self::DEFAULT.clone()
9787 }
9788}
9789impl MessageData for CAMERA_TRIGGER_DATA {
9790 type Message = MavMessage;
9791 const ID: u32 = 112u32;
9792 const NAME: &'static str = "CAMERA_TRIGGER";
9793 const EXTRA_CRC: u8 = 174u8;
9794 const ENCODED_LEN: usize = 12usize;
9795 fn deser(
9796 _version: MavlinkVersion,
9797 __input: &[u8],
9798 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9799 let avail_len = __input.len();
9800 let mut payload_buf = [0; Self::ENCODED_LEN];
9801 let mut buf = if avail_len < Self::ENCODED_LEN {
9802 payload_buf[0..avail_len].copy_from_slice(__input);
9803 Bytes::new(&payload_buf)
9804 } else {
9805 Bytes::new(__input)
9806 };
9807 let mut __struct = Self::default();
9808 __struct.time_usec = buf.get_u64_le()?;
9809 __struct.seq = buf.get_u32_le()?;
9810 Ok(__struct)
9811 }
9812 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9813 let mut __tmp = BytesMut::new(bytes);
9814 #[allow(clippy::absurd_extreme_comparisons)]
9815 #[allow(unused_comparisons)]
9816 if __tmp.remaining() < Self::ENCODED_LEN {
9817 panic!(
9818 "buffer is too small (need {} bytes, but got {})",
9819 Self::ENCODED_LEN,
9820 __tmp.remaining(),
9821 )
9822 }
9823 __tmp.put_u64_le(self.time_usec);
9824 __tmp.put_u32_le(self.seq);
9825 if matches!(version, MavlinkVersion::V2) {
9826 let len = __tmp.len();
9827 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9828 } else {
9829 __tmp.len()
9830 }
9831 }
9832}
9833#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
9834#[doc = ""]
9835#[doc = "ID: 387"]
9836#[derive(Debug, Clone, PartialEq)]
9837#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9839#[cfg_attr(feature = "ts", derive(TS))]
9840#[cfg_attr(feature = "ts", ts(export))]
9841pub struct CANFD_FRAME_DATA {
9842 #[doc = "Frame ID"]
9843 pub id: u32,
9844 #[doc = "System ID."]
9845 pub target_system: u8,
9846 #[doc = "Component ID."]
9847 pub target_component: u8,
9848 #[doc = "bus number"]
9849 pub bus: u8,
9850 #[doc = "Frame length"]
9851 pub len: u8,
9852 #[doc = "Frame data"]
9853 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9854 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9855 pub data: [u8; 64],
9856}
9857impl CANFD_FRAME_DATA {
9858 pub const ENCODED_LEN: usize = 72usize;
9859 pub const DEFAULT: Self = Self {
9860 id: 0_u32,
9861 target_system: 0_u8,
9862 target_component: 0_u8,
9863 bus: 0_u8,
9864 len: 0_u8,
9865 data: [0_u8; 64usize],
9866 };
9867 #[cfg(feature = "arbitrary")]
9868 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9869 use arbitrary::{Arbitrary, Unstructured};
9870 let mut buf = [0u8; 1024];
9871 rng.fill_bytes(&mut buf);
9872 let mut unstructured = Unstructured::new(&buf);
9873 Self::arbitrary(&mut unstructured).unwrap_or_default()
9874 }
9875}
9876impl Default for CANFD_FRAME_DATA {
9877 fn default() -> Self {
9878 Self::DEFAULT.clone()
9879 }
9880}
9881impl MessageData for CANFD_FRAME_DATA {
9882 type Message = MavMessage;
9883 const ID: u32 = 387u32;
9884 const NAME: &'static str = "CANFD_FRAME";
9885 const EXTRA_CRC: u8 = 4u8;
9886 const ENCODED_LEN: usize = 72usize;
9887 fn deser(
9888 _version: MavlinkVersion,
9889 __input: &[u8],
9890 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9891 let avail_len = __input.len();
9892 let mut payload_buf = [0; Self::ENCODED_LEN];
9893 let mut buf = if avail_len < Self::ENCODED_LEN {
9894 payload_buf[0..avail_len].copy_from_slice(__input);
9895 Bytes::new(&payload_buf)
9896 } else {
9897 Bytes::new(__input)
9898 };
9899 let mut __struct = Self::default();
9900 __struct.id = buf.get_u32_le()?;
9901 __struct.target_system = buf.get_u8()?;
9902 __struct.target_component = buf.get_u8()?;
9903 __struct.bus = buf.get_u8()?;
9904 __struct.len = buf.get_u8()?;
9905 for v in &mut __struct.data {
9906 let val = buf.get_u8()?;
9907 *v = val;
9908 }
9909 Ok(__struct)
9910 }
9911 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9912 let mut __tmp = BytesMut::new(bytes);
9913 #[allow(clippy::absurd_extreme_comparisons)]
9914 #[allow(unused_comparisons)]
9915 if __tmp.remaining() < Self::ENCODED_LEN {
9916 panic!(
9917 "buffer is too small (need {} bytes, but got {})",
9918 Self::ENCODED_LEN,
9919 __tmp.remaining(),
9920 )
9921 }
9922 __tmp.put_u32_le(self.id);
9923 __tmp.put_u8(self.target_system);
9924 __tmp.put_u8(self.target_component);
9925 __tmp.put_u8(self.bus);
9926 __tmp.put_u8(self.len);
9927 for val in &self.data {
9928 __tmp.put_u8(*val);
9929 }
9930 if matches!(version, MavlinkVersion::V2) {
9931 let len = __tmp.len();
9932 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9933 } else {
9934 __tmp.len()
9935 }
9936 }
9937}
9938#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
9939#[doc = ""]
9940#[doc = "ID: 388"]
9941#[derive(Debug, Clone, PartialEq)]
9942#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9943#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9944#[cfg_attr(feature = "ts", derive(TS))]
9945#[cfg_attr(feature = "ts", ts(export))]
9946pub struct CAN_FILTER_MODIFY_DATA {
9947 #[doc = "filter IDs, length num_ids"]
9948 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9949 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9950 pub ids: [u16; 16],
9951 #[doc = "System ID."]
9952 pub target_system: u8,
9953 #[doc = "Component ID."]
9954 pub target_component: u8,
9955 #[doc = "bus number"]
9956 pub bus: u8,
9957 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
9958 pub operation: CanFilterOp,
9959 #[doc = "number of IDs in filter list"]
9960 pub num_ids: u8,
9961}
9962impl CAN_FILTER_MODIFY_DATA {
9963 pub const ENCODED_LEN: usize = 37usize;
9964 pub const DEFAULT: Self = Self {
9965 ids: [0_u16; 16usize],
9966 target_system: 0_u8,
9967 target_component: 0_u8,
9968 bus: 0_u8,
9969 operation: CanFilterOp::DEFAULT,
9970 num_ids: 0_u8,
9971 };
9972 #[cfg(feature = "arbitrary")]
9973 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9974 use arbitrary::{Arbitrary, Unstructured};
9975 let mut buf = [0u8; 1024];
9976 rng.fill_bytes(&mut buf);
9977 let mut unstructured = Unstructured::new(&buf);
9978 Self::arbitrary(&mut unstructured).unwrap_or_default()
9979 }
9980}
9981impl Default for CAN_FILTER_MODIFY_DATA {
9982 fn default() -> Self {
9983 Self::DEFAULT.clone()
9984 }
9985}
9986impl MessageData for CAN_FILTER_MODIFY_DATA {
9987 type Message = MavMessage;
9988 const ID: u32 = 388u32;
9989 const NAME: &'static str = "CAN_FILTER_MODIFY";
9990 const EXTRA_CRC: u8 = 8u8;
9991 const ENCODED_LEN: usize = 37usize;
9992 fn deser(
9993 _version: MavlinkVersion,
9994 __input: &[u8],
9995 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9996 let avail_len = __input.len();
9997 let mut payload_buf = [0; Self::ENCODED_LEN];
9998 let mut buf = if avail_len < Self::ENCODED_LEN {
9999 payload_buf[0..avail_len].copy_from_slice(__input);
10000 Bytes::new(&payload_buf)
10001 } else {
10002 Bytes::new(__input)
10003 };
10004 let mut __struct = Self::default();
10005 for v in &mut __struct.ids {
10006 let val = buf.get_u16_le()?;
10007 *v = val;
10008 }
10009 __struct.target_system = buf.get_u8()?;
10010 __struct.target_component = buf.get_u8()?;
10011 __struct.bus = buf.get_u8()?;
10012 let tmp = buf.get_u8()?;
10013 __struct.operation =
10014 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10015 enum_type: "CanFilterOp",
10016 value: tmp as u64,
10017 })?;
10018 __struct.num_ids = buf.get_u8()?;
10019 Ok(__struct)
10020 }
10021 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10022 let mut __tmp = BytesMut::new(bytes);
10023 #[allow(clippy::absurd_extreme_comparisons)]
10024 #[allow(unused_comparisons)]
10025 if __tmp.remaining() < Self::ENCODED_LEN {
10026 panic!(
10027 "buffer is too small (need {} bytes, but got {})",
10028 Self::ENCODED_LEN,
10029 __tmp.remaining(),
10030 )
10031 }
10032 for val in &self.ids {
10033 __tmp.put_u16_le(*val);
10034 }
10035 __tmp.put_u8(self.target_system);
10036 __tmp.put_u8(self.target_component);
10037 __tmp.put_u8(self.bus);
10038 __tmp.put_u8(self.operation as u8);
10039 __tmp.put_u8(self.num_ids);
10040 if matches!(version, MavlinkVersion::V2) {
10041 let len = __tmp.len();
10042 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10043 } else {
10044 __tmp.len()
10045 }
10046 }
10047}
10048#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
10049#[doc = ""]
10050#[doc = "ID: 386"]
10051#[derive(Debug, Clone, PartialEq)]
10052#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10053#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10054#[cfg_attr(feature = "ts", derive(TS))]
10055#[cfg_attr(feature = "ts", ts(export))]
10056pub struct CAN_FRAME_DATA {
10057 #[doc = "Frame ID"]
10058 pub id: u32,
10059 #[doc = "System ID."]
10060 pub target_system: u8,
10061 #[doc = "Component ID."]
10062 pub target_component: u8,
10063 #[doc = "Bus number"]
10064 pub bus: u8,
10065 #[doc = "Frame length"]
10066 pub len: u8,
10067 #[doc = "Frame data"]
10068 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10069 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10070 pub data: [u8; 8],
10071}
10072impl CAN_FRAME_DATA {
10073 pub const ENCODED_LEN: usize = 16usize;
10074 pub const DEFAULT: Self = Self {
10075 id: 0_u32,
10076 target_system: 0_u8,
10077 target_component: 0_u8,
10078 bus: 0_u8,
10079 len: 0_u8,
10080 data: [0_u8; 8usize],
10081 };
10082 #[cfg(feature = "arbitrary")]
10083 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10084 use arbitrary::{Arbitrary, Unstructured};
10085 let mut buf = [0u8; 1024];
10086 rng.fill_bytes(&mut buf);
10087 let mut unstructured = Unstructured::new(&buf);
10088 Self::arbitrary(&mut unstructured).unwrap_or_default()
10089 }
10090}
10091impl Default for CAN_FRAME_DATA {
10092 fn default() -> Self {
10093 Self::DEFAULT.clone()
10094 }
10095}
10096impl MessageData for CAN_FRAME_DATA {
10097 type Message = MavMessage;
10098 const ID: u32 = 386u32;
10099 const NAME: &'static str = "CAN_FRAME";
10100 const EXTRA_CRC: u8 = 132u8;
10101 const ENCODED_LEN: usize = 16usize;
10102 fn deser(
10103 _version: MavlinkVersion,
10104 __input: &[u8],
10105 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10106 let avail_len = __input.len();
10107 let mut payload_buf = [0; Self::ENCODED_LEN];
10108 let mut buf = if avail_len < Self::ENCODED_LEN {
10109 payload_buf[0..avail_len].copy_from_slice(__input);
10110 Bytes::new(&payload_buf)
10111 } else {
10112 Bytes::new(__input)
10113 };
10114 let mut __struct = Self::default();
10115 __struct.id = buf.get_u32_le()?;
10116 __struct.target_system = buf.get_u8()?;
10117 __struct.target_component = buf.get_u8()?;
10118 __struct.bus = buf.get_u8()?;
10119 __struct.len = buf.get_u8()?;
10120 for v in &mut __struct.data {
10121 let val = buf.get_u8()?;
10122 *v = val;
10123 }
10124 Ok(__struct)
10125 }
10126 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10127 let mut __tmp = BytesMut::new(bytes);
10128 #[allow(clippy::absurd_extreme_comparisons)]
10129 #[allow(unused_comparisons)]
10130 if __tmp.remaining() < Self::ENCODED_LEN {
10131 panic!(
10132 "buffer is too small (need {} bytes, but got {})",
10133 Self::ENCODED_LEN,
10134 __tmp.remaining(),
10135 )
10136 }
10137 __tmp.put_u32_le(self.id);
10138 __tmp.put_u8(self.target_system);
10139 __tmp.put_u8(self.target_component);
10140 __tmp.put_u8(self.bus);
10141 __tmp.put_u8(self.len);
10142 for val in &self.data {
10143 __tmp.put_u8(*val);
10144 }
10145 if matches!(version, MavlinkVersion::V2) {
10146 let len = __tmp.len();
10147 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10148 } else {
10149 __tmp.len()
10150 }
10151 }
10152}
10153#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
10154#[doc = ""]
10155#[doc = "ID: 336"]
10156#[derive(Debug, Clone, PartialEq)]
10157#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10159#[cfg_attr(feature = "ts", derive(TS))]
10160#[cfg_attr(feature = "ts", ts(export))]
10161pub struct CELLULAR_CONFIG_DATA {
10162 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
10163 pub enable_lte: u8,
10164 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
10165 pub enable_pin: u8,
10166 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
10167 #[cfg_attr(feature = "ts", ts(type = "string"))]
10168 pub pin: CharArray<16>,
10169 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
10170 #[cfg_attr(feature = "ts", ts(type = "string"))]
10171 pub new_pin: CharArray<16>,
10172 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
10173 #[cfg_attr(feature = "ts", ts(type = "string"))]
10174 pub apn: CharArray<32>,
10175 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
10176 #[cfg_attr(feature = "ts", ts(type = "string"))]
10177 pub puk: CharArray<16>,
10178 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
10179 pub roaming: u8,
10180 #[doc = "Message acceptance response (sent back to GS)."]
10181 pub response: CellularConfigResponse,
10182}
10183impl CELLULAR_CONFIG_DATA {
10184 pub const ENCODED_LEN: usize = 84usize;
10185 pub const DEFAULT: Self = Self {
10186 enable_lte: 0_u8,
10187 enable_pin: 0_u8,
10188 pin: CharArray::new([0_u8; 16usize]),
10189 new_pin: CharArray::new([0_u8; 16usize]),
10190 apn: CharArray::new([0_u8; 32usize]),
10191 puk: CharArray::new([0_u8; 16usize]),
10192 roaming: 0_u8,
10193 response: CellularConfigResponse::DEFAULT,
10194 };
10195 #[cfg(feature = "arbitrary")]
10196 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10197 use arbitrary::{Arbitrary, Unstructured};
10198 let mut buf = [0u8; 1024];
10199 rng.fill_bytes(&mut buf);
10200 let mut unstructured = Unstructured::new(&buf);
10201 Self::arbitrary(&mut unstructured).unwrap_or_default()
10202 }
10203}
10204impl Default for CELLULAR_CONFIG_DATA {
10205 fn default() -> Self {
10206 Self::DEFAULT.clone()
10207 }
10208}
10209impl MessageData for CELLULAR_CONFIG_DATA {
10210 type Message = MavMessage;
10211 const ID: u32 = 336u32;
10212 const NAME: &'static str = "CELLULAR_CONFIG";
10213 const EXTRA_CRC: u8 = 245u8;
10214 const ENCODED_LEN: usize = 84usize;
10215 fn deser(
10216 _version: MavlinkVersion,
10217 __input: &[u8],
10218 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10219 let avail_len = __input.len();
10220 let mut payload_buf = [0; Self::ENCODED_LEN];
10221 let mut buf = if avail_len < Self::ENCODED_LEN {
10222 payload_buf[0..avail_len].copy_from_slice(__input);
10223 Bytes::new(&payload_buf)
10224 } else {
10225 Bytes::new(__input)
10226 };
10227 let mut __struct = Self::default();
10228 __struct.enable_lte = buf.get_u8()?;
10229 __struct.enable_pin = buf.get_u8()?;
10230 let mut tmp = [0_u8; 16usize];
10231 for v in &mut tmp {
10232 *v = buf.get_u8()?;
10233 }
10234 __struct.pin = CharArray::new(tmp);
10235 let mut tmp = [0_u8; 16usize];
10236 for v in &mut tmp {
10237 *v = buf.get_u8()?;
10238 }
10239 __struct.new_pin = CharArray::new(tmp);
10240 let mut tmp = [0_u8; 32usize];
10241 for v in &mut tmp {
10242 *v = buf.get_u8()?;
10243 }
10244 __struct.apn = CharArray::new(tmp);
10245 let mut tmp = [0_u8; 16usize];
10246 for v in &mut tmp {
10247 *v = buf.get_u8()?;
10248 }
10249 __struct.puk = CharArray::new(tmp);
10250 __struct.roaming = buf.get_u8()?;
10251 let tmp = buf.get_u8()?;
10252 __struct.response =
10253 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10254 enum_type: "CellularConfigResponse",
10255 value: tmp as u64,
10256 })?;
10257 Ok(__struct)
10258 }
10259 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10260 let mut __tmp = BytesMut::new(bytes);
10261 #[allow(clippy::absurd_extreme_comparisons)]
10262 #[allow(unused_comparisons)]
10263 if __tmp.remaining() < Self::ENCODED_LEN {
10264 panic!(
10265 "buffer is too small (need {} bytes, but got {})",
10266 Self::ENCODED_LEN,
10267 __tmp.remaining(),
10268 )
10269 }
10270 __tmp.put_u8(self.enable_lte);
10271 __tmp.put_u8(self.enable_pin);
10272 for val in &self.pin {
10273 __tmp.put_u8(*val);
10274 }
10275 for val in &self.new_pin {
10276 __tmp.put_u8(*val);
10277 }
10278 for val in &self.apn {
10279 __tmp.put_u8(*val);
10280 }
10281 for val in &self.puk {
10282 __tmp.put_u8(*val);
10283 }
10284 __tmp.put_u8(self.roaming);
10285 __tmp.put_u8(self.response as u8);
10286 if matches!(version, MavlinkVersion::V2) {
10287 let len = __tmp.len();
10288 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10289 } else {
10290 __tmp.len()
10291 }
10292 }
10293}
10294#[doc = "Report current used cellular network status."]
10295#[doc = ""]
10296#[doc = "ID: 334"]
10297#[derive(Debug, Clone, PartialEq)]
10298#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10299#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10300#[cfg_attr(feature = "ts", derive(TS))]
10301#[cfg_attr(feature = "ts", ts(export))]
10302pub struct CELLULAR_STATUS_DATA {
10303 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
10304 pub mcc: u16,
10305 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
10306 pub mnc: u16,
10307 #[doc = "Location area code. If unknown, set to 0"]
10308 pub lac: u16,
10309 #[doc = "Cellular modem status"]
10310 pub status: CellularStatusFlag,
10311 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
10312 pub failure_reason: CellularNetworkFailedReason,
10313 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
10314 pub mavtype: CellularNetworkRadioType,
10315 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
10316 pub quality: u8,
10317}
10318impl CELLULAR_STATUS_DATA {
10319 pub const ENCODED_LEN: usize = 10usize;
10320 pub const DEFAULT: Self = Self {
10321 mcc: 0_u16,
10322 mnc: 0_u16,
10323 lac: 0_u16,
10324 status: CellularStatusFlag::DEFAULT,
10325 failure_reason: CellularNetworkFailedReason::DEFAULT,
10326 mavtype: CellularNetworkRadioType::DEFAULT,
10327 quality: 0_u8,
10328 };
10329 #[cfg(feature = "arbitrary")]
10330 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10331 use arbitrary::{Arbitrary, Unstructured};
10332 let mut buf = [0u8; 1024];
10333 rng.fill_bytes(&mut buf);
10334 let mut unstructured = Unstructured::new(&buf);
10335 Self::arbitrary(&mut unstructured).unwrap_or_default()
10336 }
10337}
10338impl Default for CELLULAR_STATUS_DATA {
10339 fn default() -> Self {
10340 Self::DEFAULT.clone()
10341 }
10342}
10343impl MessageData for CELLULAR_STATUS_DATA {
10344 type Message = MavMessage;
10345 const ID: u32 = 334u32;
10346 const NAME: &'static str = "CELLULAR_STATUS";
10347 const EXTRA_CRC: u8 = 72u8;
10348 const ENCODED_LEN: usize = 10usize;
10349 fn deser(
10350 _version: MavlinkVersion,
10351 __input: &[u8],
10352 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10353 let avail_len = __input.len();
10354 let mut payload_buf = [0; Self::ENCODED_LEN];
10355 let mut buf = if avail_len < Self::ENCODED_LEN {
10356 payload_buf[0..avail_len].copy_from_slice(__input);
10357 Bytes::new(&payload_buf)
10358 } else {
10359 Bytes::new(__input)
10360 };
10361 let mut __struct = Self::default();
10362 __struct.mcc = buf.get_u16_le()?;
10363 __struct.mnc = buf.get_u16_le()?;
10364 __struct.lac = buf.get_u16_le()?;
10365 let tmp = buf.get_u8()?;
10366 __struct.status =
10367 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10368 enum_type: "CellularStatusFlag",
10369 value: tmp as u64,
10370 })?;
10371 let tmp = buf.get_u8()?;
10372 __struct.failure_reason =
10373 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10374 enum_type: "CellularNetworkFailedReason",
10375 value: tmp as u64,
10376 })?;
10377 let tmp = buf.get_u8()?;
10378 __struct.mavtype =
10379 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10380 enum_type: "CellularNetworkRadioType",
10381 value: tmp as u64,
10382 })?;
10383 __struct.quality = buf.get_u8()?;
10384 Ok(__struct)
10385 }
10386 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10387 let mut __tmp = BytesMut::new(bytes);
10388 #[allow(clippy::absurd_extreme_comparisons)]
10389 #[allow(unused_comparisons)]
10390 if __tmp.remaining() < Self::ENCODED_LEN {
10391 panic!(
10392 "buffer is too small (need {} bytes, but got {})",
10393 Self::ENCODED_LEN,
10394 __tmp.remaining(),
10395 )
10396 }
10397 __tmp.put_u16_le(self.mcc);
10398 __tmp.put_u16_le(self.mnc);
10399 __tmp.put_u16_le(self.lac);
10400 __tmp.put_u8(self.status as u8);
10401 __tmp.put_u8(self.failure_reason as u8);
10402 __tmp.put_u8(self.mavtype as u8);
10403 __tmp.put_u8(self.quality);
10404 if matches!(version, MavlinkVersion::V2) {
10405 let len = __tmp.len();
10406 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10407 } else {
10408 __tmp.len()
10409 }
10410 }
10411}
10412#[doc = "Request to control this MAV."]
10413#[doc = ""]
10414#[doc = "ID: 5"]
10415#[derive(Debug, Clone, PartialEq)]
10416#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10417#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10418#[cfg_attr(feature = "ts", derive(TS))]
10419#[cfg_attr(feature = "ts", ts(export))]
10420pub struct CHANGE_OPERATOR_CONTROL_DATA {
10421 #[doc = "System the GCS requests control for"]
10422 pub target_system: u8,
10423 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
10424 pub control_request: u8,
10425 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
10426 pub version: u8,
10427 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
10428 #[cfg_attr(feature = "ts", ts(type = "string"))]
10429 pub passkey: CharArray<25>,
10430}
10431impl CHANGE_OPERATOR_CONTROL_DATA {
10432 pub const ENCODED_LEN: usize = 28usize;
10433 pub const DEFAULT: Self = Self {
10434 target_system: 0_u8,
10435 control_request: 0_u8,
10436 version: 0_u8,
10437 passkey: CharArray::new([0_u8; 25usize]),
10438 };
10439 #[cfg(feature = "arbitrary")]
10440 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10441 use arbitrary::{Arbitrary, Unstructured};
10442 let mut buf = [0u8; 1024];
10443 rng.fill_bytes(&mut buf);
10444 let mut unstructured = Unstructured::new(&buf);
10445 Self::arbitrary(&mut unstructured).unwrap_or_default()
10446 }
10447}
10448impl Default for CHANGE_OPERATOR_CONTROL_DATA {
10449 fn default() -> Self {
10450 Self::DEFAULT.clone()
10451 }
10452}
10453impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
10454 type Message = MavMessage;
10455 const ID: u32 = 5u32;
10456 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
10457 const EXTRA_CRC: u8 = 217u8;
10458 const ENCODED_LEN: usize = 28usize;
10459 fn deser(
10460 _version: MavlinkVersion,
10461 __input: &[u8],
10462 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10463 let avail_len = __input.len();
10464 let mut payload_buf = [0; Self::ENCODED_LEN];
10465 let mut buf = if avail_len < Self::ENCODED_LEN {
10466 payload_buf[0..avail_len].copy_from_slice(__input);
10467 Bytes::new(&payload_buf)
10468 } else {
10469 Bytes::new(__input)
10470 };
10471 let mut __struct = Self::default();
10472 __struct.target_system = buf.get_u8()?;
10473 __struct.control_request = buf.get_u8()?;
10474 __struct.version = buf.get_u8()?;
10475 let mut tmp = [0_u8; 25usize];
10476 for v in &mut tmp {
10477 *v = buf.get_u8()?;
10478 }
10479 __struct.passkey = CharArray::new(tmp);
10480 Ok(__struct)
10481 }
10482 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10483 let mut __tmp = BytesMut::new(bytes);
10484 #[allow(clippy::absurd_extreme_comparisons)]
10485 #[allow(unused_comparisons)]
10486 if __tmp.remaining() < Self::ENCODED_LEN {
10487 panic!(
10488 "buffer is too small (need {} bytes, but got {})",
10489 Self::ENCODED_LEN,
10490 __tmp.remaining(),
10491 )
10492 }
10493 __tmp.put_u8(self.target_system);
10494 __tmp.put_u8(self.control_request);
10495 __tmp.put_u8(self.version);
10496 for val in &self.passkey {
10497 __tmp.put_u8(*val);
10498 }
10499 if matches!(version, MavlinkVersion::V2) {
10500 let len = __tmp.len();
10501 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10502 } else {
10503 __tmp.len()
10504 }
10505 }
10506}
10507#[doc = "Accept / deny control of this MAV."]
10508#[doc = ""]
10509#[doc = "ID: 6"]
10510#[derive(Debug, Clone, PartialEq)]
10511#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10512#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10513#[cfg_attr(feature = "ts", derive(TS))]
10514#[cfg_attr(feature = "ts", ts(export))]
10515pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
10516 #[doc = "ID of the GCS this message"]
10517 pub gcs_system_id: u8,
10518 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
10519 pub control_request: u8,
10520 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
10521 pub ack: u8,
10522}
10523impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
10524 pub const ENCODED_LEN: usize = 3usize;
10525 pub const DEFAULT: Self = Self {
10526 gcs_system_id: 0_u8,
10527 control_request: 0_u8,
10528 ack: 0_u8,
10529 };
10530 #[cfg(feature = "arbitrary")]
10531 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10532 use arbitrary::{Arbitrary, Unstructured};
10533 let mut buf = [0u8; 1024];
10534 rng.fill_bytes(&mut buf);
10535 let mut unstructured = Unstructured::new(&buf);
10536 Self::arbitrary(&mut unstructured).unwrap_or_default()
10537 }
10538}
10539impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
10540 fn default() -> Self {
10541 Self::DEFAULT.clone()
10542 }
10543}
10544impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
10545 type Message = MavMessage;
10546 const ID: u32 = 6u32;
10547 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
10548 const EXTRA_CRC: u8 = 104u8;
10549 const ENCODED_LEN: usize = 3usize;
10550 fn deser(
10551 _version: MavlinkVersion,
10552 __input: &[u8],
10553 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10554 let avail_len = __input.len();
10555 let mut payload_buf = [0; Self::ENCODED_LEN];
10556 let mut buf = if avail_len < Self::ENCODED_LEN {
10557 payload_buf[0..avail_len].copy_from_slice(__input);
10558 Bytes::new(&payload_buf)
10559 } else {
10560 Bytes::new(__input)
10561 };
10562 let mut __struct = Self::default();
10563 __struct.gcs_system_id = buf.get_u8()?;
10564 __struct.control_request = buf.get_u8()?;
10565 __struct.ack = buf.get_u8()?;
10566 Ok(__struct)
10567 }
10568 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10569 let mut __tmp = BytesMut::new(bytes);
10570 #[allow(clippy::absurd_extreme_comparisons)]
10571 #[allow(unused_comparisons)]
10572 if __tmp.remaining() < Self::ENCODED_LEN {
10573 panic!(
10574 "buffer is too small (need {} bytes, but got {})",
10575 Self::ENCODED_LEN,
10576 __tmp.remaining(),
10577 )
10578 }
10579 __tmp.put_u8(self.gcs_system_id);
10580 __tmp.put_u8(self.control_request);
10581 __tmp.put_u8(self.ack);
10582 if matches!(version, MavlinkVersion::V2) {
10583 let len = __tmp.len();
10584 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10585 } else {
10586 __tmp.len()
10587 }
10588 }
10589}
10590#[doc = "Information about a potential collision."]
10591#[doc = ""]
10592#[doc = "ID: 247"]
10593#[derive(Debug, Clone, PartialEq)]
10594#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10595#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10596#[cfg_attr(feature = "ts", derive(TS))]
10597#[cfg_attr(feature = "ts", ts(export))]
10598pub struct COLLISION_DATA {
10599 #[doc = "Unique identifier, domain based on src field"]
10600 pub id: u32,
10601 #[doc = "Estimated time until collision occurs"]
10602 pub time_to_minimum_delta: f32,
10603 #[doc = "Closest vertical distance between vehicle and object"]
10604 pub altitude_minimum_delta: f32,
10605 #[doc = "Closest horizontal distance between vehicle and object"]
10606 pub horizontal_minimum_delta: f32,
10607 #[doc = "Collision data source"]
10608 pub src: MavCollisionSrc,
10609 #[doc = "Action that is being taken to avoid this collision"]
10610 pub action: MavCollisionAction,
10611 #[doc = "How concerned the aircraft is about this collision"]
10612 pub threat_level: MavCollisionThreatLevel,
10613}
10614impl COLLISION_DATA {
10615 pub const ENCODED_LEN: usize = 19usize;
10616 pub const DEFAULT: Self = Self {
10617 id: 0_u32,
10618 time_to_minimum_delta: 0.0_f32,
10619 altitude_minimum_delta: 0.0_f32,
10620 horizontal_minimum_delta: 0.0_f32,
10621 src: MavCollisionSrc::DEFAULT,
10622 action: MavCollisionAction::DEFAULT,
10623 threat_level: MavCollisionThreatLevel::DEFAULT,
10624 };
10625 #[cfg(feature = "arbitrary")]
10626 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10627 use arbitrary::{Arbitrary, Unstructured};
10628 let mut buf = [0u8; 1024];
10629 rng.fill_bytes(&mut buf);
10630 let mut unstructured = Unstructured::new(&buf);
10631 Self::arbitrary(&mut unstructured).unwrap_or_default()
10632 }
10633}
10634impl Default for COLLISION_DATA {
10635 fn default() -> Self {
10636 Self::DEFAULT.clone()
10637 }
10638}
10639impl MessageData for COLLISION_DATA {
10640 type Message = MavMessage;
10641 const ID: u32 = 247u32;
10642 const NAME: &'static str = "COLLISION";
10643 const EXTRA_CRC: u8 = 81u8;
10644 const ENCODED_LEN: usize = 19usize;
10645 fn deser(
10646 _version: MavlinkVersion,
10647 __input: &[u8],
10648 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10649 let avail_len = __input.len();
10650 let mut payload_buf = [0; Self::ENCODED_LEN];
10651 let mut buf = if avail_len < Self::ENCODED_LEN {
10652 payload_buf[0..avail_len].copy_from_slice(__input);
10653 Bytes::new(&payload_buf)
10654 } else {
10655 Bytes::new(__input)
10656 };
10657 let mut __struct = Self::default();
10658 __struct.id = buf.get_u32_le()?;
10659 __struct.time_to_minimum_delta = buf.get_f32_le()?;
10660 __struct.altitude_minimum_delta = buf.get_f32_le()?;
10661 __struct.horizontal_minimum_delta = buf.get_f32_le()?;
10662 let tmp = buf.get_u8()?;
10663 __struct.src =
10664 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10665 enum_type: "MavCollisionSrc",
10666 value: tmp as u64,
10667 })?;
10668 let tmp = buf.get_u8()?;
10669 __struct.action =
10670 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10671 enum_type: "MavCollisionAction",
10672 value: tmp as u64,
10673 })?;
10674 let tmp = buf.get_u8()?;
10675 __struct.threat_level =
10676 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10677 enum_type: "MavCollisionThreatLevel",
10678 value: tmp as u64,
10679 })?;
10680 Ok(__struct)
10681 }
10682 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10683 let mut __tmp = BytesMut::new(bytes);
10684 #[allow(clippy::absurd_extreme_comparisons)]
10685 #[allow(unused_comparisons)]
10686 if __tmp.remaining() < Self::ENCODED_LEN {
10687 panic!(
10688 "buffer is too small (need {} bytes, but got {})",
10689 Self::ENCODED_LEN,
10690 __tmp.remaining(),
10691 )
10692 }
10693 __tmp.put_u32_le(self.id);
10694 __tmp.put_f32_le(self.time_to_minimum_delta);
10695 __tmp.put_f32_le(self.altitude_minimum_delta);
10696 __tmp.put_f32_le(self.horizontal_minimum_delta);
10697 __tmp.put_u8(self.src as u8);
10698 __tmp.put_u8(self.action as u8);
10699 __tmp.put_u8(self.threat_level as u8);
10700 if matches!(version, MavlinkVersion::V2) {
10701 let len = __tmp.len();
10702 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10703 } else {
10704 __tmp.len()
10705 }
10706 }
10707}
10708#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
10709#[doc = ""]
10710#[doc = "ID: 77"]
10711#[derive(Debug, Clone, PartialEq)]
10712#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10713#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10714#[cfg_attr(feature = "ts", derive(TS))]
10715#[cfg_attr(feature = "ts", ts(export))]
10716pub struct COMMAND_ACK_DATA {
10717 #[doc = "Command ID (of acknowledged command)."]
10718 pub command: MavCmd,
10719 #[doc = "Result of command."]
10720 pub result: MavResult,
10721 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
10722 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10723 pub progress: u8,
10724 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
10725 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10726 pub result_param2: i32,
10727 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
10728 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10729 pub target_system: u8,
10730 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
10731 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10732 pub target_component: u8,
10733}
10734impl COMMAND_ACK_DATA {
10735 pub const ENCODED_LEN: usize = 10usize;
10736 pub const DEFAULT: Self = Self {
10737 command: MavCmd::DEFAULT,
10738 result: MavResult::DEFAULT,
10739 progress: 0_u8,
10740 result_param2: 0_i32,
10741 target_system: 0_u8,
10742 target_component: 0_u8,
10743 };
10744 #[cfg(feature = "arbitrary")]
10745 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10746 use arbitrary::{Arbitrary, Unstructured};
10747 let mut buf = [0u8; 1024];
10748 rng.fill_bytes(&mut buf);
10749 let mut unstructured = Unstructured::new(&buf);
10750 Self::arbitrary(&mut unstructured).unwrap_or_default()
10751 }
10752}
10753impl Default for COMMAND_ACK_DATA {
10754 fn default() -> Self {
10755 Self::DEFAULT.clone()
10756 }
10757}
10758impl MessageData for COMMAND_ACK_DATA {
10759 type Message = MavMessage;
10760 const ID: u32 = 77u32;
10761 const NAME: &'static str = "COMMAND_ACK";
10762 const EXTRA_CRC: u8 = 143u8;
10763 const ENCODED_LEN: usize = 10usize;
10764 fn deser(
10765 _version: MavlinkVersion,
10766 __input: &[u8],
10767 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10768 let avail_len = __input.len();
10769 let mut payload_buf = [0; Self::ENCODED_LEN];
10770 let mut buf = if avail_len < Self::ENCODED_LEN {
10771 payload_buf[0..avail_len].copy_from_slice(__input);
10772 Bytes::new(&payload_buf)
10773 } else {
10774 Bytes::new(__input)
10775 };
10776 let mut __struct = Self::default();
10777 let tmp = buf.get_u16_le()?;
10778 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
10779 ::mavlink_core::error::ParserError::InvalidEnum {
10780 enum_type: "MavCmd",
10781 value: tmp as u64,
10782 },
10783 )?;
10784 let tmp = buf.get_u8()?;
10785 __struct.result =
10786 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10787 enum_type: "MavResult",
10788 value: tmp as u64,
10789 })?;
10790 __struct.progress = buf.get_u8()?;
10791 __struct.result_param2 = buf.get_i32_le()?;
10792 __struct.target_system = buf.get_u8()?;
10793 __struct.target_component = buf.get_u8()?;
10794 Ok(__struct)
10795 }
10796 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10797 let mut __tmp = BytesMut::new(bytes);
10798 #[allow(clippy::absurd_extreme_comparisons)]
10799 #[allow(unused_comparisons)]
10800 if __tmp.remaining() < Self::ENCODED_LEN {
10801 panic!(
10802 "buffer is too small (need {} bytes, but got {})",
10803 Self::ENCODED_LEN,
10804 __tmp.remaining(),
10805 )
10806 }
10807 __tmp.put_u16_le(self.command as u16);
10808 __tmp.put_u8(self.result as u8);
10809 if matches!(version, MavlinkVersion::V2) {
10810 __tmp.put_u8(self.progress);
10811 __tmp.put_i32_le(self.result_param2);
10812 __tmp.put_u8(self.target_system);
10813 __tmp.put_u8(self.target_component);
10814 let len = __tmp.len();
10815 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10816 } else {
10817 __tmp.len()
10818 }
10819 }
10820}
10821#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
10822#[doc = ""]
10823#[doc = "ID: 80"]
10824#[derive(Debug, Clone, PartialEq)]
10825#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10826#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10827#[cfg_attr(feature = "ts", derive(TS))]
10828#[cfg_attr(feature = "ts", ts(export))]
10829pub struct COMMAND_CANCEL_DATA {
10830 #[doc = "Command ID (of command to cancel)."]
10831 pub command: MavCmd,
10832 #[doc = "System executing long running command. Should not be broadcast (0)."]
10833 pub target_system: u8,
10834 #[doc = "Component executing long running command."]
10835 pub target_component: u8,
10836}
10837impl COMMAND_CANCEL_DATA {
10838 pub const ENCODED_LEN: usize = 4usize;
10839 pub const DEFAULT: Self = Self {
10840 command: MavCmd::DEFAULT,
10841 target_system: 0_u8,
10842 target_component: 0_u8,
10843 };
10844 #[cfg(feature = "arbitrary")]
10845 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10846 use arbitrary::{Arbitrary, Unstructured};
10847 let mut buf = [0u8; 1024];
10848 rng.fill_bytes(&mut buf);
10849 let mut unstructured = Unstructured::new(&buf);
10850 Self::arbitrary(&mut unstructured).unwrap_or_default()
10851 }
10852}
10853impl Default for COMMAND_CANCEL_DATA {
10854 fn default() -> Self {
10855 Self::DEFAULT.clone()
10856 }
10857}
10858impl MessageData for COMMAND_CANCEL_DATA {
10859 type Message = MavMessage;
10860 const ID: u32 = 80u32;
10861 const NAME: &'static str = "COMMAND_CANCEL";
10862 const EXTRA_CRC: u8 = 14u8;
10863 const ENCODED_LEN: usize = 4usize;
10864 fn deser(
10865 _version: MavlinkVersion,
10866 __input: &[u8],
10867 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10868 let avail_len = __input.len();
10869 let mut payload_buf = [0; Self::ENCODED_LEN];
10870 let mut buf = if avail_len < Self::ENCODED_LEN {
10871 payload_buf[0..avail_len].copy_from_slice(__input);
10872 Bytes::new(&payload_buf)
10873 } else {
10874 Bytes::new(__input)
10875 };
10876 let mut __struct = Self::default();
10877 let tmp = buf.get_u16_le()?;
10878 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
10879 ::mavlink_core::error::ParserError::InvalidEnum {
10880 enum_type: "MavCmd",
10881 value: tmp as u64,
10882 },
10883 )?;
10884 __struct.target_system = buf.get_u8()?;
10885 __struct.target_component = buf.get_u8()?;
10886 Ok(__struct)
10887 }
10888 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10889 let mut __tmp = BytesMut::new(bytes);
10890 #[allow(clippy::absurd_extreme_comparisons)]
10891 #[allow(unused_comparisons)]
10892 if __tmp.remaining() < Self::ENCODED_LEN {
10893 panic!(
10894 "buffer is too small (need {} bytes, but got {})",
10895 Self::ENCODED_LEN,
10896 __tmp.remaining(),
10897 )
10898 }
10899 __tmp.put_u16_le(self.command as u16);
10900 __tmp.put_u8(self.target_system);
10901 __tmp.put_u8(self.target_component);
10902 if matches!(version, MavlinkVersion::V2) {
10903 let len = __tmp.len();
10904 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10905 } else {
10906 __tmp.len()
10907 }
10908 }
10909}
10910#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
10911#[doc = ""]
10912#[doc = "ID: 75"]
10913#[derive(Debug, Clone, PartialEq)]
10914#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10916#[cfg_attr(feature = "ts", derive(TS))]
10917#[cfg_attr(feature = "ts", ts(export))]
10918pub struct COMMAND_INT_DATA {
10919 #[doc = "PARAM1, see MAV_CMD enum"]
10920 pub param1: f32,
10921 #[doc = "PARAM2, see MAV_CMD enum"]
10922 pub param2: f32,
10923 #[doc = "PARAM3, see MAV_CMD enum"]
10924 pub param3: f32,
10925 #[doc = "PARAM4, see MAV_CMD enum"]
10926 pub param4: f32,
10927 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
10928 pub x: i32,
10929 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
10930 pub y: i32,
10931 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
10932 pub z: f32,
10933 #[doc = "The scheduled action for the mission item."]
10934 pub command: MavCmd,
10935 #[doc = "System ID"]
10936 pub target_system: u8,
10937 #[doc = "Component ID"]
10938 pub target_component: u8,
10939 #[doc = "The coordinate system of the COMMAND."]
10940 pub frame: MavFrame,
10941 #[doc = "Not used."]
10942 pub current: u8,
10943 #[doc = "Not used (set 0)."]
10944 pub autocontinue: u8,
10945}
10946impl COMMAND_INT_DATA {
10947 pub const ENCODED_LEN: usize = 35usize;
10948 pub const DEFAULT: Self = Self {
10949 param1: 0.0_f32,
10950 param2: 0.0_f32,
10951 param3: 0.0_f32,
10952 param4: 0.0_f32,
10953 x: 0_i32,
10954 y: 0_i32,
10955 z: 0.0_f32,
10956 command: MavCmd::DEFAULT,
10957 target_system: 0_u8,
10958 target_component: 0_u8,
10959 frame: MavFrame::DEFAULT,
10960 current: 0_u8,
10961 autocontinue: 0_u8,
10962 };
10963 #[cfg(feature = "arbitrary")]
10964 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10965 use arbitrary::{Arbitrary, Unstructured};
10966 let mut buf = [0u8; 1024];
10967 rng.fill_bytes(&mut buf);
10968 let mut unstructured = Unstructured::new(&buf);
10969 Self::arbitrary(&mut unstructured).unwrap_or_default()
10970 }
10971}
10972impl Default for COMMAND_INT_DATA {
10973 fn default() -> Self {
10974 Self::DEFAULT.clone()
10975 }
10976}
10977impl MessageData for COMMAND_INT_DATA {
10978 type Message = MavMessage;
10979 const ID: u32 = 75u32;
10980 const NAME: &'static str = "COMMAND_INT";
10981 const EXTRA_CRC: u8 = 158u8;
10982 const ENCODED_LEN: usize = 35usize;
10983 fn deser(
10984 _version: MavlinkVersion,
10985 __input: &[u8],
10986 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10987 let avail_len = __input.len();
10988 let mut payload_buf = [0; Self::ENCODED_LEN];
10989 let mut buf = if avail_len < Self::ENCODED_LEN {
10990 payload_buf[0..avail_len].copy_from_slice(__input);
10991 Bytes::new(&payload_buf)
10992 } else {
10993 Bytes::new(__input)
10994 };
10995 let mut __struct = Self::default();
10996 __struct.param1 = buf.get_f32_le()?;
10997 __struct.param2 = buf.get_f32_le()?;
10998 __struct.param3 = buf.get_f32_le()?;
10999 __struct.param4 = buf.get_f32_le()?;
11000 __struct.x = buf.get_i32_le()?;
11001 __struct.y = buf.get_i32_le()?;
11002 __struct.z = buf.get_f32_le()?;
11003 let tmp = buf.get_u16_le()?;
11004 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
11005 ::mavlink_core::error::ParserError::InvalidEnum {
11006 enum_type: "MavCmd",
11007 value: tmp as u64,
11008 },
11009 )?;
11010 __struct.target_system = buf.get_u8()?;
11011 __struct.target_component = buf.get_u8()?;
11012 let tmp = buf.get_u8()?;
11013 __struct.frame =
11014 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11015 enum_type: "MavFrame",
11016 value: tmp as u64,
11017 })?;
11018 __struct.current = buf.get_u8()?;
11019 __struct.autocontinue = buf.get_u8()?;
11020 Ok(__struct)
11021 }
11022 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11023 let mut __tmp = BytesMut::new(bytes);
11024 #[allow(clippy::absurd_extreme_comparisons)]
11025 #[allow(unused_comparisons)]
11026 if __tmp.remaining() < Self::ENCODED_LEN {
11027 panic!(
11028 "buffer is too small (need {} bytes, but got {})",
11029 Self::ENCODED_LEN,
11030 __tmp.remaining(),
11031 )
11032 }
11033 __tmp.put_f32_le(self.param1);
11034 __tmp.put_f32_le(self.param2);
11035 __tmp.put_f32_le(self.param3);
11036 __tmp.put_f32_le(self.param4);
11037 __tmp.put_i32_le(self.x);
11038 __tmp.put_i32_le(self.y);
11039 __tmp.put_f32_le(self.z);
11040 __tmp.put_u16_le(self.command as u16);
11041 __tmp.put_u8(self.target_system);
11042 __tmp.put_u8(self.target_component);
11043 __tmp.put_u8(self.frame as u8);
11044 __tmp.put_u8(self.current);
11045 __tmp.put_u8(self.autocontinue);
11046 if matches!(version, MavlinkVersion::V2) {
11047 let len = __tmp.len();
11048 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11049 } else {
11050 __tmp.len()
11051 }
11052 }
11053}
11054#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
11055#[doc = ""]
11056#[doc = "ID: 76"]
11057#[derive(Debug, Clone, PartialEq)]
11058#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11059#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11060#[cfg_attr(feature = "ts", derive(TS))]
11061#[cfg_attr(feature = "ts", ts(export))]
11062pub struct COMMAND_LONG_DATA {
11063 #[doc = "Parameter 1 (for the specific command)."]
11064 pub param1: f32,
11065 #[doc = "Parameter 2 (for the specific command)."]
11066 pub param2: f32,
11067 #[doc = "Parameter 3 (for the specific command)."]
11068 pub param3: f32,
11069 #[doc = "Parameter 4 (for the specific command)."]
11070 pub param4: f32,
11071 #[doc = "Parameter 5 (for the specific command)."]
11072 pub param5: f32,
11073 #[doc = "Parameter 6 (for the specific command)."]
11074 pub param6: f32,
11075 #[doc = "Parameter 7 (for the specific command)."]
11076 pub param7: f32,
11077 #[doc = "Command ID (of command to send)."]
11078 pub command: MavCmd,
11079 #[doc = "System which should execute the command"]
11080 pub target_system: u8,
11081 #[doc = "Component which should execute the command, 0 for all components"]
11082 pub target_component: u8,
11083 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
11084 pub confirmation: u8,
11085}
11086impl COMMAND_LONG_DATA {
11087 pub const ENCODED_LEN: usize = 33usize;
11088 pub const DEFAULT: Self = Self {
11089 param1: 0.0_f32,
11090 param2: 0.0_f32,
11091 param3: 0.0_f32,
11092 param4: 0.0_f32,
11093 param5: 0.0_f32,
11094 param6: 0.0_f32,
11095 param7: 0.0_f32,
11096 command: MavCmd::DEFAULT,
11097 target_system: 0_u8,
11098 target_component: 0_u8,
11099 confirmation: 0_u8,
11100 };
11101 #[cfg(feature = "arbitrary")]
11102 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11103 use arbitrary::{Arbitrary, Unstructured};
11104 let mut buf = [0u8; 1024];
11105 rng.fill_bytes(&mut buf);
11106 let mut unstructured = Unstructured::new(&buf);
11107 Self::arbitrary(&mut unstructured).unwrap_or_default()
11108 }
11109}
11110impl Default for COMMAND_LONG_DATA {
11111 fn default() -> Self {
11112 Self::DEFAULT.clone()
11113 }
11114}
11115impl MessageData for COMMAND_LONG_DATA {
11116 type Message = MavMessage;
11117 const ID: u32 = 76u32;
11118 const NAME: &'static str = "COMMAND_LONG";
11119 const EXTRA_CRC: u8 = 152u8;
11120 const ENCODED_LEN: usize = 33usize;
11121 fn deser(
11122 _version: MavlinkVersion,
11123 __input: &[u8],
11124 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11125 let avail_len = __input.len();
11126 let mut payload_buf = [0; Self::ENCODED_LEN];
11127 let mut buf = if avail_len < Self::ENCODED_LEN {
11128 payload_buf[0..avail_len].copy_from_slice(__input);
11129 Bytes::new(&payload_buf)
11130 } else {
11131 Bytes::new(__input)
11132 };
11133 let mut __struct = Self::default();
11134 __struct.param1 = buf.get_f32_le()?;
11135 __struct.param2 = buf.get_f32_le()?;
11136 __struct.param3 = buf.get_f32_le()?;
11137 __struct.param4 = buf.get_f32_le()?;
11138 __struct.param5 = buf.get_f32_le()?;
11139 __struct.param6 = buf.get_f32_le()?;
11140 __struct.param7 = buf.get_f32_le()?;
11141 let tmp = buf.get_u16_le()?;
11142 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
11143 ::mavlink_core::error::ParserError::InvalidEnum {
11144 enum_type: "MavCmd",
11145 value: tmp as u64,
11146 },
11147 )?;
11148 __struct.target_system = buf.get_u8()?;
11149 __struct.target_component = buf.get_u8()?;
11150 __struct.confirmation = buf.get_u8()?;
11151 Ok(__struct)
11152 }
11153 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11154 let mut __tmp = BytesMut::new(bytes);
11155 #[allow(clippy::absurd_extreme_comparisons)]
11156 #[allow(unused_comparisons)]
11157 if __tmp.remaining() < Self::ENCODED_LEN {
11158 panic!(
11159 "buffer is too small (need {} bytes, but got {})",
11160 Self::ENCODED_LEN,
11161 __tmp.remaining(),
11162 )
11163 }
11164 __tmp.put_f32_le(self.param1);
11165 __tmp.put_f32_le(self.param2);
11166 __tmp.put_f32_le(self.param3);
11167 __tmp.put_f32_le(self.param4);
11168 __tmp.put_f32_le(self.param5);
11169 __tmp.put_f32_le(self.param6);
11170 __tmp.put_f32_le(self.param7);
11171 __tmp.put_u16_le(self.command as u16);
11172 __tmp.put_u8(self.target_system);
11173 __tmp.put_u8(self.target_component);
11174 __tmp.put_u8(self.confirmation);
11175 if matches!(version, MavlinkVersion::V2) {
11176 let len = __tmp.len();
11177 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11178 } else {
11179 __tmp.len()
11180 }
11181 }
11182}
11183#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
11184#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
11185#[doc = ""]
11186#[doc = "ID: 395"]
11187#[derive(Debug, Clone, PartialEq)]
11188#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11189#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11190#[cfg_attr(feature = "ts", derive(TS))]
11191#[cfg_attr(feature = "ts", ts(export))]
11192pub struct COMPONENT_INFORMATION_DATA {
11193 #[doc = "Timestamp (time since system boot)."]
11194 pub time_boot_ms: u32,
11195 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
11196 pub general_metadata_file_crc: u32,
11197 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
11198 pub peripherals_metadata_file_crc: u32,
11199 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
11200 #[cfg_attr(feature = "ts", ts(type = "string"))]
11201 pub general_metadata_uri: CharArray<100>,
11202 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
11203 #[cfg_attr(feature = "ts", ts(type = "string"))]
11204 pub peripherals_metadata_uri: CharArray<100>,
11205}
11206impl COMPONENT_INFORMATION_DATA {
11207 pub const ENCODED_LEN: usize = 212usize;
11208 pub const DEFAULT: Self = Self {
11209 time_boot_ms: 0_u32,
11210 general_metadata_file_crc: 0_u32,
11211 peripherals_metadata_file_crc: 0_u32,
11212 general_metadata_uri: CharArray::new([0_u8; 100usize]),
11213 peripherals_metadata_uri: CharArray::new([0_u8; 100usize]),
11214 };
11215 #[cfg(feature = "arbitrary")]
11216 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11217 use arbitrary::{Arbitrary, Unstructured};
11218 let mut buf = [0u8; 1024];
11219 rng.fill_bytes(&mut buf);
11220 let mut unstructured = Unstructured::new(&buf);
11221 Self::arbitrary(&mut unstructured).unwrap_or_default()
11222 }
11223}
11224impl Default for COMPONENT_INFORMATION_DATA {
11225 fn default() -> Self {
11226 Self::DEFAULT.clone()
11227 }
11228}
11229impl MessageData for COMPONENT_INFORMATION_DATA {
11230 type Message = MavMessage;
11231 const ID: u32 = 395u32;
11232 const NAME: &'static str = "COMPONENT_INFORMATION";
11233 const EXTRA_CRC: u8 = 0u8;
11234 const ENCODED_LEN: usize = 212usize;
11235 fn deser(
11236 _version: MavlinkVersion,
11237 __input: &[u8],
11238 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11239 let avail_len = __input.len();
11240 let mut payload_buf = [0; Self::ENCODED_LEN];
11241 let mut buf = if avail_len < Self::ENCODED_LEN {
11242 payload_buf[0..avail_len].copy_from_slice(__input);
11243 Bytes::new(&payload_buf)
11244 } else {
11245 Bytes::new(__input)
11246 };
11247 let mut __struct = Self::default();
11248 __struct.time_boot_ms = buf.get_u32_le()?;
11249 __struct.general_metadata_file_crc = buf.get_u32_le()?;
11250 __struct.peripherals_metadata_file_crc = buf.get_u32_le()?;
11251 let mut tmp = [0_u8; 100usize];
11252 for v in &mut tmp {
11253 *v = buf.get_u8()?;
11254 }
11255 __struct.general_metadata_uri = CharArray::new(tmp);
11256 let mut tmp = [0_u8; 100usize];
11257 for v in &mut tmp {
11258 *v = buf.get_u8()?;
11259 }
11260 __struct.peripherals_metadata_uri = CharArray::new(tmp);
11261 Ok(__struct)
11262 }
11263 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11264 let mut __tmp = BytesMut::new(bytes);
11265 #[allow(clippy::absurd_extreme_comparisons)]
11266 #[allow(unused_comparisons)]
11267 if __tmp.remaining() < Self::ENCODED_LEN {
11268 panic!(
11269 "buffer is too small (need {} bytes, but got {})",
11270 Self::ENCODED_LEN,
11271 __tmp.remaining(),
11272 )
11273 }
11274 __tmp.put_u32_le(self.time_boot_ms);
11275 __tmp.put_u32_le(self.general_metadata_file_crc);
11276 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
11277 for val in &self.general_metadata_uri {
11278 __tmp.put_u8(*val);
11279 }
11280 for val in &self.peripherals_metadata_uri {
11281 __tmp.put_u8(*val);
11282 }
11283 if matches!(version, MavlinkVersion::V2) {
11284 let len = __tmp.len();
11285 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11286 } else {
11287 __tmp.len()
11288 }
11289 }
11290}
11291#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
11292#[doc = ""]
11293#[doc = "ID: 396"]
11294#[derive(Debug, Clone, PartialEq)]
11295#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11296#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11297#[cfg_attr(feature = "ts", derive(TS))]
11298#[cfg_attr(feature = "ts", ts(export))]
11299pub struct COMPONENT_INFORMATION_BASIC_DATA {
11300 #[doc = "Component capability flags"]
11301 pub capabilities: MavProtocolCapability,
11302 #[doc = "Timestamp (time since system boot)."]
11303 pub time_boot_ms: u32,
11304 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
11305 pub time_manufacture_s: u32,
11306 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
11307 #[cfg_attr(feature = "ts", ts(type = "string"))]
11308 pub vendor_name: CharArray<32>,
11309 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
11310 #[cfg_attr(feature = "ts", ts(type = "string"))]
11311 pub model_name: CharArray<32>,
11312 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
11313 #[cfg_attr(feature = "ts", ts(type = "string"))]
11314 pub software_version: CharArray<24>,
11315 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
11316 #[cfg_attr(feature = "ts", ts(type = "string"))]
11317 pub hardware_version: CharArray<24>,
11318 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
11319 #[cfg_attr(feature = "ts", ts(type = "string"))]
11320 pub serial_number: CharArray<32>,
11321}
11322impl COMPONENT_INFORMATION_BASIC_DATA {
11323 pub const ENCODED_LEN: usize = 160usize;
11324 pub const DEFAULT: Self = Self {
11325 capabilities: MavProtocolCapability::DEFAULT,
11326 time_boot_ms: 0_u32,
11327 time_manufacture_s: 0_u32,
11328 vendor_name: CharArray::new([0_u8; 32usize]),
11329 model_name: CharArray::new([0_u8; 32usize]),
11330 software_version: CharArray::new([0_u8; 24usize]),
11331 hardware_version: CharArray::new([0_u8; 24usize]),
11332 serial_number: CharArray::new([0_u8; 32usize]),
11333 };
11334 #[cfg(feature = "arbitrary")]
11335 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11336 use arbitrary::{Arbitrary, Unstructured};
11337 let mut buf = [0u8; 1024];
11338 rng.fill_bytes(&mut buf);
11339 let mut unstructured = Unstructured::new(&buf);
11340 Self::arbitrary(&mut unstructured).unwrap_or_default()
11341 }
11342}
11343impl Default for COMPONENT_INFORMATION_BASIC_DATA {
11344 fn default() -> Self {
11345 Self::DEFAULT.clone()
11346 }
11347}
11348impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
11349 type Message = MavMessage;
11350 const ID: u32 = 396u32;
11351 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
11352 const EXTRA_CRC: u8 = 50u8;
11353 const ENCODED_LEN: usize = 160usize;
11354 fn deser(
11355 _version: MavlinkVersion,
11356 __input: &[u8],
11357 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11358 let avail_len = __input.len();
11359 let mut payload_buf = [0; Self::ENCODED_LEN];
11360 let mut buf = if avail_len < Self::ENCODED_LEN {
11361 payload_buf[0..avail_len].copy_from_slice(__input);
11362 Bytes::new(&payload_buf)
11363 } else {
11364 Bytes::new(__input)
11365 };
11366 let mut __struct = Self::default();
11367 let tmp = buf.get_u64_le()?;
11368 __struct.capabilities = MavProtocolCapability::from_bits(
11369 tmp as <MavProtocolCapability as Flags>::Bits,
11370 )
11371 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11372 flag_type: "MavProtocolCapability",
11373 value: tmp as u64,
11374 })?;
11375 __struct.time_boot_ms = buf.get_u32_le()?;
11376 __struct.time_manufacture_s = buf.get_u32_le()?;
11377 let mut tmp = [0_u8; 32usize];
11378 for v in &mut tmp {
11379 *v = buf.get_u8()?;
11380 }
11381 __struct.vendor_name = CharArray::new(tmp);
11382 let mut tmp = [0_u8; 32usize];
11383 for v in &mut tmp {
11384 *v = buf.get_u8()?;
11385 }
11386 __struct.model_name = CharArray::new(tmp);
11387 let mut tmp = [0_u8; 24usize];
11388 for v in &mut tmp {
11389 *v = buf.get_u8()?;
11390 }
11391 __struct.software_version = CharArray::new(tmp);
11392 let mut tmp = [0_u8; 24usize];
11393 for v in &mut tmp {
11394 *v = buf.get_u8()?;
11395 }
11396 __struct.hardware_version = CharArray::new(tmp);
11397 let mut tmp = [0_u8; 32usize];
11398 for v in &mut tmp {
11399 *v = buf.get_u8()?;
11400 }
11401 __struct.serial_number = CharArray::new(tmp);
11402 Ok(__struct)
11403 }
11404 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11405 let mut __tmp = BytesMut::new(bytes);
11406 #[allow(clippy::absurd_extreme_comparisons)]
11407 #[allow(unused_comparisons)]
11408 if __tmp.remaining() < Self::ENCODED_LEN {
11409 panic!(
11410 "buffer is too small (need {} bytes, but got {})",
11411 Self::ENCODED_LEN,
11412 __tmp.remaining(),
11413 )
11414 }
11415 __tmp.put_u64_le(self.capabilities.bits() as u64);
11416 __tmp.put_u32_le(self.time_boot_ms);
11417 __tmp.put_u32_le(self.time_manufacture_s);
11418 for val in &self.vendor_name {
11419 __tmp.put_u8(*val);
11420 }
11421 for val in &self.model_name {
11422 __tmp.put_u8(*val);
11423 }
11424 for val in &self.software_version {
11425 __tmp.put_u8(*val);
11426 }
11427 for val in &self.hardware_version {
11428 __tmp.put_u8(*val);
11429 }
11430 for val in &self.serial_number {
11431 __tmp.put_u8(*val);
11432 }
11433 if matches!(version, MavlinkVersion::V2) {
11434 let len = __tmp.len();
11435 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11436 } else {
11437 __tmp.len()
11438 }
11439 }
11440}
11441#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
11442#[doc = ""]
11443#[doc = "ID: 397"]
11444#[derive(Debug, Clone, PartialEq)]
11445#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11446#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11447#[cfg_attr(feature = "ts", derive(TS))]
11448#[cfg_attr(feature = "ts", ts(export))]
11449pub struct COMPONENT_METADATA_DATA {
11450 #[doc = "Timestamp (time since system boot)."]
11451 pub time_boot_ms: u32,
11452 #[doc = "CRC32 of the general metadata file."]
11453 pub file_crc: u32,
11454 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
11455 #[cfg_attr(feature = "ts", ts(type = "string"))]
11456 pub uri: CharArray<100>,
11457}
11458impl COMPONENT_METADATA_DATA {
11459 pub const ENCODED_LEN: usize = 108usize;
11460 pub const DEFAULT: Self = Self {
11461 time_boot_ms: 0_u32,
11462 file_crc: 0_u32,
11463 uri: CharArray::new([0_u8; 100usize]),
11464 };
11465 #[cfg(feature = "arbitrary")]
11466 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11467 use arbitrary::{Arbitrary, Unstructured};
11468 let mut buf = [0u8; 1024];
11469 rng.fill_bytes(&mut buf);
11470 let mut unstructured = Unstructured::new(&buf);
11471 Self::arbitrary(&mut unstructured).unwrap_or_default()
11472 }
11473}
11474impl Default for COMPONENT_METADATA_DATA {
11475 fn default() -> Self {
11476 Self::DEFAULT.clone()
11477 }
11478}
11479impl MessageData for COMPONENT_METADATA_DATA {
11480 type Message = MavMessage;
11481 const ID: u32 = 397u32;
11482 const NAME: &'static str = "COMPONENT_METADATA";
11483 const EXTRA_CRC: u8 = 182u8;
11484 const ENCODED_LEN: usize = 108usize;
11485 fn deser(
11486 _version: MavlinkVersion,
11487 __input: &[u8],
11488 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11489 let avail_len = __input.len();
11490 let mut payload_buf = [0; Self::ENCODED_LEN];
11491 let mut buf = if avail_len < Self::ENCODED_LEN {
11492 payload_buf[0..avail_len].copy_from_slice(__input);
11493 Bytes::new(&payload_buf)
11494 } else {
11495 Bytes::new(__input)
11496 };
11497 let mut __struct = Self::default();
11498 __struct.time_boot_ms = buf.get_u32_le()?;
11499 __struct.file_crc = buf.get_u32_le()?;
11500 let mut tmp = [0_u8; 100usize];
11501 for v in &mut tmp {
11502 *v = buf.get_u8()?;
11503 }
11504 __struct.uri = CharArray::new(tmp);
11505 Ok(__struct)
11506 }
11507 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11508 let mut __tmp = BytesMut::new(bytes);
11509 #[allow(clippy::absurd_extreme_comparisons)]
11510 #[allow(unused_comparisons)]
11511 if __tmp.remaining() < Self::ENCODED_LEN {
11512 panic!(
11513 "buffer is too small (need {} bytes, but got {})",
11514 Self::ENCODED_LEN,
11515 __tmp.remaining(),
11516 )
11517 }
11518 __tmp.put_u32_le(self.time_boot_ms);
11519 __tmp.put_u32_le(self.file_crc);
11520 for val in &self.uri {
11521 __tmp.put_u8(*val);
11522 }
11523 if matches!(version, MavlinkVersion::V2) {
11524 let len = __tmp.len();
11525 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11526 } else {
11527 __tmp.len()
11528 }
11529 }
11530}
11531#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
11532#[doc = ""]
11533#[doc = "ID: 146"]
11534#[derive(Debug, Clone, PartialEq)]
11535#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11536#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11537#[cfg_attr(feature = "ts", derive(TS))]
11538#[cfg_attr(feature = "ts", ts(export))]
11539pub struct CONTROL_SYSTEM_STATE_DATA {
11540 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11541 pub time_usec: u64,
11542 #[doc = "X acceleration in body frame"]
11543 pub x_acc: f32,
11544 #[doc = "Y acceleration in body frame"]
11545 pub y_acc: f32,
11546 #[doc = "Z acceleration in body frame"]
11547 pub z_acc: f32,
11548 #[doc = "X velocity in body frame"]
11549 pub x_vel: f32,
11550 #[doc = "Y velocity in body frame"]
11551 pub y_vel: f32,
11552 #[doc = "Z velocity in body frame"]
11553 pub z_vel: f32,
11554 #[doc = "X position in local frame"]
11555 pub x_pos: f32,
11556 #[doc = "Y position in local frame"]
11557 pub y_pos: f32,
11558 #[doc = "Z position in local frame"]
11559 pub z_pos: f32,
11560 #[doc = "Airspeed, set to -1 if unknown"]
11561 pub airspeed: f32,
11562 #[doc = "Variance of body velocity estimate"]
11563 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11564 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11565 pub vel_variance: [f32; 3],
11566 #[doc = "Variance in local position"]
11567 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11568 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11569 pub pos_variance: [f32; 3],
11570 #[doc = "The attitude, represented as Quaternion"]
11571 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11572 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11573 pub q: [f32; 4],
11574 #[doc = "Angular rate in roll axis"]
11575 pub roll_rate: f32,
11576 #[doc = "Angular rate in pitch axis"]
11577 pub pitch_rate: f32,
11578 #[doc = "Angular rate in yaw axis"]
11579 pub yaw_rate: f32,
11580}
11581impl CONTROL_SYSTEM_STATE_DATA {
11582 pub const ENCODED_LEN: usize = 100usize;
11583 pub const DEFAULT: Self = Self {
11584 time_usec: 0_u64,
11585 x_acc: 0.0_f32,
11586 y_acc: 0.0_f32,
11587 z_acc: 0.0_f32,
11588 x_vel: 0.0_f32,
11589 y_vel: 0.0_f32,
11590 z_vel: 0.0_f32,
11591 x_pos: 0.0_f32,
11592 y_pos: 0.0_f32,
11593 z_pos: 0.0_f32,
11594 airspeed: 0.0_f32,
11595 vel_variance: [0.0_f32; 3usize],
11596 pos_variance: [0.0_f32; 3usize],
11597 q: [0.0_f32; 4usize],
11598 roll_rate: 0.0_f32,
11599 pitch_rate: 0.0_f32,
11600 yaw_rate: 0.0_f32,
11601 };
11602 #[cfg(feature = "arbitrary")]
11603 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11604 use arbitrary::{Arbitrary, Unstructured};
11605 let mut buf = [0u8; 1024];
11606 rng.fill_bytes(&mut buf);
11607 let mut unstructured = Unstructured::new(&buf);
11608 Self::arbitrary(&mut unstructured).unwrap_or_default()
11609 }
11610}
11611impl Default for CONTROL_SYSTEM_STATE_DATA {
11612 fn default() -> Self {
11613 Self::DEFAULT.clone()
11614 }
11615}
11616impl MessageData for CONTROL_SYSTEM_STATE_DATA {
11617 type Message = MavMessage;
11618 const ID: u32 = 146u32;
11619 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
11620 const EXTRA_CRC: u8 = 103u8;
11621 const ENCODED_LEN: usize = 100usize;
11622 fn deser(
11623 _version: MavlinkVersion,
11624 __input: &[u8],
11625 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11626 let avail_len = __input.len();
11627 let mut payload_buf = [0; Self::ENCODED_LEN];
11628 let mut buf = if avail_len < Self::ENCODED_LEN {
11629 payload_buf[0..avail_len].copy_from_slice(__input);
11630 Bytes::new(&payload_buf)
11631 } else {
11632 Bytes::new(__input)
11633 };
11634 let mut __struct = Self::default();
11635 __struct.time_usec = buf.get_u64_le()?;
11636 __struct.x_acc = buf.get_f32_le()?;
11637 __struct.y_acc = buf.get_f32_le()?;
11638 __struct.z_acc = buf.get_f32_le()?;
11639 __struct.x_vel = buf.get_f32_le()?;
11640 __struct.y_vel = buf.get_f32_le()?;
11641 __struct.z_vel = buf.get_f32_le()?;
11642 __struct.x_pos = buf.get_f32_le()?;
11643 __struct.y_pos = buf.get_f32_le()?;
11644 __struct.z_pos = buf.get_f32_le()?;
11645 __struct.airspeed = buf.get_f32_le()?;
11646 for v in &mut __struct.vel_variance {
11647 let val = buf.get_f32_le()?;
11648 *v = val;
11649 }
11650 for v in &mut __struct.pos_variance {
11651 let val = buf.get_f32_le()?;
11652 *v = val;
11653 }
11654 for v in &mut __struct.q {
11655 let val = buf.get_f32_le()?;
11656 *v = val;
11657 }
11658 __struct.roll_rate = buf.get_f32_le()?;
11659 __struct.pitch_rate = buf.get_f32_le()?;
11660 __struct.yaw_rate = buf.get_f32_le()?;
11661 Ok(__struct)
11662 }
11663 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11664 let mut __tmp = BytesMut::new(bytes);
11665 #[allow(clippy::absurd_extreme_comparisons)]
11666 #[allow(unused_comparisons)]
11667 if __tmp.remaining() < Self::ENCODED_LEN {
11668 panic!(
11669 "buffer is too small (need {} bytes, but got {})",
11670 Self::ENCODED_LEN,
11671 __tmp.remaining(),
11672 )
11673 }
11674 __tmp.put_u64_le(self.time_usec);
11675 __tmp.put_f32_le(self.x_acc);
11676 __tmp.put_f32_le(self.y_acc);
11677 __tmp.put_f32_le(self.z_acc);
11678 __tmp.put_f32_le(self.x_vel);
11679 __tmp.put_f32_le(self.y_vel);
11680 __tmp.put_f32_le(self.z_vel);
11681 __tmp.put_f32_le(self.x_pos);
11682 __tmp.put_f32_le(self.y_pos);
11683 __tmp.put_f32_le(self.z_pos);
11684 __tmp.put_f32_le(self.airspeed);
11685 for val in &self.vel_variance {
11686 __tmp.put_f32_le(*val);
11687 }
11688 for val in &self.pos_variance {
11689 __tmp.put_f32_le(*val);
11690 }
11691 for val in &self.q {
11692 __tmp.put_f32_le(*val);
11693 }
11694 __tmp.put_f32_le(self.roll_rate);
11695 __tmp.put_f32_le(self.pitch_rate);
11696 __tmp.put_f32_le(self.yaw_rate);
11697 if matches!(version, MavlinkVersion::V2) {
11698 let len = __tmp.len();
11699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11700 } else {
11701 __tmp.len()
11702 }
11703 }
11704}
11705#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
11706#[doc = ""]
11707#[doc = "ID: 411"]
11708#[derive(Debug, Clone, PartialEq)]
11709#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11710#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11711#[cfg_attr(feature = "ts", derive(TS))]
11712#[cfg_attr(feature = "ts", ts(export))]
11713pub struct CURRENT_EVENT_SEQUENCE_DATA {
11714 #[doc = "Sequence number."]
11715 pub sequence: u16,
11716 #[doc = "Flag bitset."]
11717 pub flags: MavEventCurrentSequenceFlags,
11718}
11719impl CURRENT_EVENT_SEQUENCE_DATA {
11720 pub const ENCODED_LEN: usize = 3usize;
11721 pub const DEFAULT: Self = Self {
11722 sequence: 0_u16,
11723 flags: MavEventCurrentSequenceFlags::DEFAULT,
11724 };
11725 #[cfg(feature = "arbitrary")]
11726 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11727 use arbitrary::{Arbitrary, Unstructured};
11728 let mut buf = [0u8; 1024];
11729 rng.fill_bytes(&mut buf);
11730 let mut unstructured = Unstructured::new(&buf);
11731 Self::arbitrary(&mut unstructured).unwrap_or_default()
11732 }
11733}
11734impl Default for CURRENT_EVENT_SEQUENCE_DATA {
11735 fn default() -> Self {
11736 Self::DEFAULT.clone()
11737 }
11738}
11739impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
11740 type Message = MavMessage;
11741 const ID: u32 = 411u32;
11742 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
11743 const EXTRA_CRC: u8 = 106u8;
11744 const ENCODED_LEN: usize = 3usize;
11745 fn deser(
11746 _version: MavlinkVersion,
11747 __input: &[u8],
11748 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11749 let avail_len = __input.len();
11750 let mut payload_buf = [0; Self::ENCODED_LEN];
11751 let mut buf = if avail_len < Self::ENCODED_LEN {
11752 payload_buf[0..avail_len].copy_from_slice(__input);
11753 Bytes::new(&payload_buf)
11754 } else {
11755 Bytes::new(__input)
11756 };
11757 let mut __struct = Self::default();
11758 __struct.sequence = buf.get_u16_le()?;
11759 let tmp = buf.get_u8()?;
11760 __struct.flags =
11761 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11762 enum_type: "MavEventCurrentSequenceFlags",
11763 value: tmp as u64,
11764 })?;
11765 Ok(__struct)
11766 }
11767 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11768 let mut __tmp = BytesMut::new(bytes);
11769 #[allow(clippy::absurd_extreme_comparisons)]
11770 #[allow(unused_comparisons)]
11771 if __tmp.remaining() < Self::ENCODED_LEN {
11772 panic!(
11773 "buffer is too small (need {} bytes, but got {})",
11774 Self::ENCODED_LEN,
11775 __tmp.remaining(),
11776 )
11777 }
11778 __tmp.put_u16_le(self.sequence);
11779 __tmp.put_u8(self.flags as u8);
11780 if matches!(version, MavlinkVersion::V2) {
11781 let len = __tmp.len();
11782 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11783 } else {
11784 __tmp.len()
11785 }
11786 }
11787}
11788#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
11789#[doc = ""]
11790#[doc = "ID: 436"]
11791#[derive(Debug, Clone, PartialEq)]
11792#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11793#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11794#[cfg_attr(feature = "ts", derive(TS))]
11795#[cfg_attr(feature = "ts", ts(export))]
11796pub struct CURRENT_MODE_DATA {
11797 #[doc = "A bitfield for use for autopilot-specific flags"]
11798 pub custom_mode: u32,
11799 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
11800 pub intended_custom_mode: u32,
11801 #[doc = "Standard mode."]
11802 pub standard_mode: MavStandardMode,
11803}
11804impl CURRENT_MODE_DATA {
11805 pub const ENCODED_LEN: usize = 9usize;
11806 pub const DEFAULT: Self = Self {
11807 custom_mode: 0_u32,
11808 intended_custom_mode: 0_u32,
11809 standard_mode: MavStandardMode::DEFAULT,
11810 };
11811 #[cfg(feature = "arbitrary")]
11812 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11813 use arbitrary::{Arbitrary, Unstructured};
11814 let mut buf = [0u8; 1024];
11815 rng.fill_bytes(&mut buf);
11816 let mut unstructured = Unstructured::new(&buf);
11817 Self::arbitrary(&mut unstructured).unwrap_or_default()
11818 }
11819}
11820impl Default for CURRENT_MODE_DATA {
11821 fn default() -> Self {
11822 Self::DEFAULT.clone()
11823 }
11824}
11825impl MessageData for CURRENT_MODE_DATA {
11826 type Message = MavMessage;
11827 const ID: u32 = 436u32;
11828 const NAME: &'static str = "CURRENT_MODE";
11829 const EXTRA_CRC: u8 = 193u8;
11830 const ENCODED_LEN: usize = 9usize;
11831 fn deser(
11832 _version: MavlinkVersion,
11833 __input: &[u8],
11834 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11835 let avail_len = __input.len();
11836 let mut payload_buf = [0; Self::ENCODED_LEN];
11837 let mut buf = if avail_len < Self::ENCODED_LEN {
11838 payload_buf[0..avail_len].copy_from_slice(__input);
11839 Bytes::new(&payload_buf)
11840 } else {
11841 Bytes::new(__input)
11842 };
11843 let mut __struct = Self::default();
11844 __struct.custom_mode = buf.get_u32_le()?;
11845 __struct.intended_custom_mode = buf.get_u32_le()?;
11846 let tmp = buf.get_u8()?;
11847 __struct.standard_mode =
11848 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11849 enum_type: "MavStandardMode",
11850 value: tmp as u64,
11851 })?;
11852 Ok(__struct)
11853 }
11854 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11855 let mut __tmp = BytesMut::new(bytes);
11856 #[allow(clippy::absurd_extreme_comparisons)]
11857 #[allow(unused_comparisons)]
11858 if __tmp.remaining() < Self::ENCODED_LEN {
11859 panic!(
11860 "buffer is too small (need {} bytes, but got {})",
11861 Self::ENCODED_LEN,
11862 __tmp.remaining(),
11863 )
11864 }
11865 __tmp.put_u32_le(self.custom_mode);
11866 __tmp.put_u32_le(self.intended_custom_mode);
11867 __tmp.put_u8(self.standard_mode as u8);
11868 if matches!(version, MavlinkVersion::V2) {
11869 let len = __tmp.len();
11870 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11871 } else {
11872 __tmp.len()
11873 }
11874 }
11875}
11876#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
11877#[doc = "Data stream status information."]
11878#[doc = ""]
11879#[doc = "ID: 67"]
11880#[derive(Debug, Clone, PartialEq)]
11881#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11882#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11883#[cfg_attr(feature = "ts", derive(TS))]
11884#[cfg_attr(feature = "ts", ts(export))]
11885pub struct DATA_STREAM_DATA {
11886 #[doc = "The message rate"]
11887 pub message_rate: u16,
11888 #[doc = "The ID of the requested data stream"]
11889 pub stream_id: u8,
11890 #[doc = "1 stream is enabled, 0 stream is stopped."]
11891 pub on_off: u8,
11892}
11893impl DATA_STREAM_DATA {
11894 pub const ENCODED_LEN: usize = 4usize;
11895 pub const DEFAULT: Self = Self {
11896 message_rate: 0_u16,
11897 stream_id: 0_u8,
11898 on_off: 0_u8,
11899 };
11900 #[cfg(feature = "arbitrary")]
11901 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11902 use arbitrary::{Arbitrary, Unstructured};
11903 let mut buf = [0u8; 1024];
11904 rng.fill_bytes(&mut buf);
11905 let mut unstructured = Unstructured::new(&buf);
11906 Self::arbitrary(&mut unstructured).unwrap_or_default()
11907 }
11908}
11909impl Default for DATA_STREAM_DATA {
11910 fn default() -> Self {
11911 Self::DEFAULT.clone()
11912 }
11913}
11914impl MessageData for DATA_STREAM_DATA {
11915 type Message = MavMessage;
11916 const ID: u32 = 67u32;
11917 const NAME: &'static str = "DATA_STREAM";
11918 const EXTRA_CRC: u8 = 21u8;
11919 const ENCODED_LEN: usize = 4usize;
11920 fn deser(
11921 _version: MavlinkVersion,
11922 __input: &[u8],
11923 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11924 let avail_len = __input.len();
11925 let mut payload_buf = [0; Self::ENCODED_LEN];
11926 let mut buf = if avail_len < Self::ENCODED_LEN {
11927 payload_buf[0..avail_len].copy_from_slice(__input);
11928 Bytes::new(&payload_buf)
11929 } else {
11930 Bytes::new(__input)
11931 };
11932 let mut __struct = Self::default();
11933 __struct.message_rate = buf.get_u16_le()?;
11934 __struct.stream_id = buf.get_u8()?;
11935 __struct.on_off = buf.get_u8()?;
11936 Ok(__struct)
11937 }
11938 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11939 let mut __tmp = BytesMut::new(bytes);
11940 #[allow(clippy::absurd_extreme_comparisons)]
11941 #[allow(unused_comparisons)]
11942 if __tmp.remaining() < Self::ENCODED_LEN {
11943 panic!(
11944 "buffer is too small (need {} bytes, but got {})",
11945 Self::ENCODED_LEN,
11946 __tmp.remaining(),
11947 )
11948 }
11949 __tmp.put_u16_le(self.message_rate);
11950 __tmp.put_u8(self.stream_id);
11951 __tmp.put_u8(self.on_off);
11952 if matches!(version, MavlinkVersion::V2) {
11953 let len = __tmp.len();
11954 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11955 } else {
11956 __tmp.len()
11957 }
11958 }
11959}
11960#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11961#[doc = ""]
11962#[doc = "ID: 130"]
11963#[derive(Debug, Clone, PartialEq)]
11964#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11965#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11966#[cfg_attr(feature = "ts", derive(TS))]
11967#[cfg_attr(feature = "ts", ts(export))]
11968pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
11969 #[doc = "total data size (set on ACK only)."]
11970 pub size: u32,
11971 #[doc = "Width of a matrix or image."]
11972 pub width: u16,
11973 #[doc = "Height of a matrix or image."]
11974 pub height: u16,
11975 #[doc = "Number of packets being sent (set on ACK only)."]
11976 pub packets: u16,
11977 #[doc = "Type of requested/acknowledged data."]
11978 pub mavtype: MavlinkDataStreamType,
11979 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
11980 pub payload: u8,
11981 #[doc = "JPEG quality. Values: [1-100]."]
11982 pub jpg_quality: u8,
11983}
11984impl DATA_TRANSMISSION_HANDSHAKE_DATA {
11985 pub const ENCODED_LEN: usize = 13usize;
11986 pub const DEFAULT: Self = Self {
11987 size: 0_u32,
11988 width: 0_u16,
11989 height: 0_u16,
11990 packets: 0_u16,
11991 mavtype: MavlinkDataStreamType::DEFAULT,
11992 payload: 0_u8,
11993 jpg_quality: 0_u8,
11994 };
11995 #[cfg(feature = "arbitrary")]
11996 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11997 use arbitrary::{Arbitrary, Unstructured};
11998 let mut buf = [0u8; 1024];
11999 rng.fill_bytes(&mut buf);
12000 let mut unstructured = Unstructured::new(&buf);
12001 Self::arbitrary(&mut unstructured).unwrap_or_default()
12002 }
12003}
12004impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
12005 fn default() -> Self {
12006 Self::DEFAULT.clone()
12007 }
12008}
12009impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
12010 type Message = MavMessage;
12011 const ID: u32 = 130u32;
12012 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
12013 const EXTRA_CRC: u8 = 29u8;
12014 const ENCODED_LEN: usize = 13usize;
12015 fn deser(
12016 _version: MavlinkVersion,
12017 __input: &[u8],
12018 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12019 let avail_len = __input.len();
12020 let mut payload_buf = [0; Self::ENCODED_LEN];
12021 let mut buf = if avail_len < Self::ENCODED_LEN {
12022 payload_buf[0..avail_len].copy_from_slice(__input);
12023 Bytes::new(&payload_buf)
12024 } else {
12025 Bytes::new(__input)
12026 };
12027 let mut __struct = Self::default();
12028 __struct.size = buf.get_u32_le()?;
12029 __struct.width = buf.get_u16_le()?;
12030 __struct.height = buf.get_u16_le()?;
12031 __struct.packets = buf.get_u16_le()?;
12032 let tmp = buf.get_u8()?;
12033 __struct.mavtype =
12034 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12035 enum_type: "MavlinkDataStreamType",
12036 value: tmp as u64,
12037 })?;
12038 __struct.payload = buf.get_u8()?;
12039 __struct.jpg_quality = buf.get_u8()?;
12040 Ok(__struct)
12041 }
12042 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12043 let mut __tmp = BytesMut::new(bytes);
12044 #[allow(clippy::absurd_extreme_comparisons)]
12045 #[allow(unused_comparisons)]
12046 if __tmp.remaining() < Self::ENCODED_LEN {
12047 panic!(
12048 "buffer is too small (need {} bytes, but got {})",
12049 Self::ENCODED_LEN,
12050 __tmp.remaining(),
12051 )
12052 }
12053 __tmp.put_u32_le(self.size);
12054 __tmp.put_u16_le(self.width);
12055 __tmp.put_u16_le(self.height);
12056 __tmp.put_u16_le(self.packets);
12057 __tmp.put_u8(self.mavtype as u8);
12058 __tmp.put_u8(self.payload);
12059 __tmp.put_u8(self.jpg_quality);
12060 if matches!(version, MavlinkVersion::V2) {
12061 let len = __tmp.len();
12062 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12063 } else {
12064 __tmp.len()
12065 }
12066 }
12067}
12068#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
12069#[doc = ""]
12070#[doc = "ID: 254"]
12071#[derive(Debug, Clone, PartialEq)]
12072#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12073#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12074#[cfg_attr(feature = "ts", derive(TS))]
12075#[cfg_attr(feature = "ts", ts(export))]
12076pub struct DEBUG_DATA {
12077 #[doc = "Timestamp (time since system boot)."]
12078 pub time_boot_ms: u32,
12079 #[doc = "DEBUG value"]
12080 pub value: f32,
12081 #[doc = "index of debug variable"]
12082 pub ind: u8,
12083}
12084impl DEBUG_DATA {
12085 pub const ENCODED_LEN: usize = 9usize;
12086 pub const DEFAULT: Self = Self {
12087 time_boot_ms: 0_u32,
12088 value: 0.0_f32,
12089 ind: 0_u8,
12090 };
12091 #[cfg(feature = "arbitrary")]
12092 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12093 use arbitrary::{Arbitrary, Unstructured};
12094 let mut buf = [0u8; 1024];
12095 rng.fill_bytes(&mut buf);
12096 let mut unstructured = Unstructured::new(&buf);
12097 Self::arbitrary(&mut unstructured).unwrap_or_default()
12098 }
12099}
12100impl Default for DEBUG_DATA {
12101 fn default() -> Self {
12102 Self::DEFAULT.clone()
12103 }
12104}
12105impl MessageData for DEBUG_DATA {
12106 type Message = MavMessage;
12107 const ID: u32 = 254u32;
12108 const NAME: &'static str = "DEBUG";
12109 const EXTRA_CRC: u8 = 46u8;
12110 const ENCODED_LEN: usize = 9usize;
12111 fn deser(
12112 _version: MavlinkVersion,
12113 __input: &[u8],
12114 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12115 let avail_len = __input.len();
12116 let mut payload_buf = [0; Self::ENCODED_LEN];
12117 let mut buf = if avail_len < Self::ENCODED_LEN {
12118 payload_buf[0..avail_len].copy_from_slice(__input);
12119 Bytes::new(&payload_buf)
12120 } else {
12121 Bytes::new(__input)
12122 };
12123 let mut __struct = Self::default();
12124 __struct.time_boot_ms = buf.get_u32_le()?;
12125 __struct.value = buf.get_f32_le()?;
12126 __struct.ind = buf.get_u8()?;
12127 Ok(__struct)
12128 }
12129 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12130 let mut __tmp = BytesMut::new(bytes);
12131 #[allow(clippy::absurd_extreme_comparisons)]
12132 #[allow(unused_comparisons)]
12133 if __tmp.remaining() < Self::ENCODED_LEN {
12134 panic!(
12135 "buffer is too small (need {} bytes, but got {})",
12136 Self::ENCODED_LEN,
12137 __tmp.remaining(),
12138 )
12139 }
12140 __tmp.put_u32_le(self.time_boot_ms);
12141 __tmp.put_f32_le(self.value);
12142 __tmp.put_u8(self.ind);
12143 if matches!(version, MavlinkVersion::V2) {
12144 let len = __tmp.len();
12145 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12146 } else {
12147 __tmp.len()
12148 }
12149 }
12150}
12151#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
12152#[doc = ""]
12153#[doc = "ID: 350"]
12154#[derive(Debug, Clone, PartialEq)]
12155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12157#[cfg_attr(feature = "ts", derive(TS))]
12158#[cfg_attr(feature = "ts", ts(export))]
12159pub struct DEBUG_FLOAT_ARRAY_DATA {
12160 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
12161 pub time_usec: u64,
12162 #[doc = "Unique ID used to discriminate between arrays"]
12163 pub array_id: u16,
12164 #[doc = "Name, for human-friendly display in a Ground Control Station"]
12165 #[cfg_attr(feature = "ts", ts(type = "string"))]
12166 pub name: CharArray<10>,
12167 #[doc = "data"]
12168 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12169 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12170 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12171 pub data: [f32; 58],
12172}
12173impl DEBUG_FLOAT_ARRAY_DATA {
12174 pub const ENCODED_LEN: usize = 252usize;
12175 pub const DEFAULT: Self = Self {
12176 time_usec: 0_u64,
12177 array_id: 0_u16,
12178 name: CharArray::new([0_u8; 10usize]),
12179 data: [0.0_f32; 58usize],
12180 };
12181 #[cfg(feature = "arbitrary")]
12182 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12183 use arbitrary::{Arbitrary, Unstructured};
12184 let mut buf = [0u8; 1024];
12185 rng.fill_bytes(&mut buf);
12186 let mut unstructured = Unstructured::new(&buf);
12187 Self::arbitrary(&mut unstructured).unwrap_or_default()
12188 }
12189}
12190impl Default for DEBUG_FLOAT_ARRAY_DATA {
12191 fn default() -> Self {
12192 Self::DEFAULT.clone()
12193 }
12194}
12195impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
12196 type Message = MavMessage;
12197 const ID: u32 = 350u32;
12198 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
12199 const EXTRA_CRC: u8 = 232u8;
12200 const ENCODED_LEN: usize = 252usize;
12201 fn deser(
12202 _version: MavlinkVersion,
12203 __input: &[u8],
12204 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12205 let avail_len = __input.len();
12206 let mut payload_buf = [0; Self::ENCODED_LEN];
12207 let mut buf = if avail_len < Self::ENCODED_LEN {
12208 payload_buf[0..avail_len].copy_from_slice(__input);
12209 Bytes::new(&payload_buf)
12210 } else {
12211 Bytes::new(__input)
12212 };
12213 let mut __struct = Self::default();
12214 __struct.time_usec = buf.get_u64_le()?;
12215 __struct.array_id = buf.get_u16_le()?;
12216 let mut tmp = [0_u8; 10usize];
12217 for v in &mut tmp {
12218 *v = buf.get_u8()?;
12219 }
12220 __struct.name = CharArray::new(tmp);
12221 for v in &mut __struct.data {
12222 let val = buf.get_f32_le()?;
12223 *v = val;
12224 }
12225 Ok(__struct)
12226 }
12227 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12228 let mut __tmp = BytesMut::new(bytes);
12229 #[allow(clippy::absurd_extreme_comparisons)]
12230 #[allow(unused_comparisons)]
12231 if __tmp.remaining() < Self::ENCODED_LEN {
12232 panic!(
12233 "buffer is too small (need {} bytes, but got {})",
12234 Self::ENCODED_LEN,
12235 __tmp.remaining(),
12236 )
12237 }
12238 __tmp.put_u64_le(self.time_usec);
12239 __tmp.put_u16_le(self.array_id);
12240 for val in &self.name {
12241 __tmp.put_u8(*val);
12242 }
12243 if matches!(version, MavlinkVersion::V2) {
12244 for val in &self.data {
12245 __tmp.put_f32_le(*val);
12246 }
12247 let len = __tmp.len();
12248 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12249 } else {
12250 __tmp.len()
12251 }
12252 }
12253}
12254#[doc = "To debug something using a named 3D vector."]
12255#[doc = ""]
12256#[doc = "ID: 250"]
12257#[derive(Debug, Clone, PartialEq)]
12258#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12259#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12260#[cfg_attr(feature = "ts", derive(TS))]
12261#[cfg_attr(feature = "ts", ts(export))]
12262pub struct DEBUG_VECT_DATA {
12263 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
12264 pub time_usec: u64,
12265 #[doc = "x"]
12266 pub x: f32,
12267 #[doc = "y"]
12268 pub y: f32,
12269 #[doc = "z"]
12270 pub z: f32,
12271 #[doc = "Name"]
12272 #[cfg_attr(feature = "ts", ts(type = "string"))]
12273 pub name: CharArray<10>,
12274}
12275impl DEBUG_VECT_DATA {
12276 pub const ENCODED_LEN: usize = 30usize;
12277 pub const DEFAULT: Self = Self {
12278 time_usec: 0_u64,
12279 x: 0.0_f32,
12280 y: 0.0_f32,
12281 z: 0.0_f32,
12282 name: CharArray::new([0_u8; 10usize]),
12283 };
12284 #[cfg(feature = "arbitrary")]
12285 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12286 use arbitrary::{Arbitrary, Unstructured};
12287 let mut buf = [0u8; 1024];
12288 rng.fill_bytes(&mut buf);
12289 let mut unstructured = Unstructured::new(&buf);
12290 Self::arbitrary(&mut unstructured).unwrap_or_default()
12291 }
12292}
12293impl Default for DEBUG_VECT_DATA {
12294 fn default() -> Self {
12295 Self::DEFAULT.clone()
12296 }
12297}
12298impl MessageData for DEBUG_VECT_DATA {
12299 type Message = MavMessage;
12300 const ID: u32 = 250u32;
12301 const NAME: &'static str = "DEBUG_VECT";
12302 const EXTRA_CRC: u8 = 49u8;
12303 const ENCODED_LEN: usize = 30usize;
12304 fn deser(
12305 _version: MavlinkVersion,
12306 __input: &[u8],
12307 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12308 let avail_len = __input.len();
12309 let mut payload_buf = [0; Self::ENCODED_LEN];
12310 let mut buf = if avail_len < Self::ENCODED_LEN {
12311 payload_buf[0..avail_len].copy_from_slice(__input);
12312 Bytes::new(&payload_buf)
12313 } else {
12314 Bytes::new(__input)
12315 };
12316 let mut __struct = Self::default();
12317 __struct.time_usec = buf.get_u64_le()?;
12318 __struct.x = buf.get_f32_le()?;
12319 __struct.y = buf.get_f32_le()?;
12320 __struct.z = buf.get_f32_le()?;
12321 let mut tmp = [0_u8; 10usize];
12322 for v in &mut tmp {
12323 *v = buf.get_u8()?;
12324 }
12325 __struct.name = CharArray::new(tmp);
12326 Ok(__struct)
12327 }
12328 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12329 let mut __tmp = BytesMut::new(bytes);
12330 #[allow(clippy::absurd_extreme_comparisons)]
12331 #[allow(unused_comparisons)]
12332 if __tmp.remaining() < Self::ENCODED_LEN {
12333 panic!(
12334 "buffer is too small (need {} bytes, but got {})",
12335 Self::ENCODED_LEN,
12336 __tmp.remaining(),
12337 )
12338 }
12339 __tmp.put_u64_le(self.time_usec);
12340 __tmp.put_f32_le(self.x);
12341 __tmp.put_f32_le(self.y);
12342 __tmp.put_f32_le(self.z);
12343 for val in &self.name {
12344 __tmp.put_u8(*val);
12345 }
12346 if matches!(version, MavlinkVersion::V2) {
12347 let len = __tmp.len();
12348 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12349 } else {
12350 __tmp.len()
12351 }
12352 }
12353}
12354#[doc = "Distance sensor information for an onboard rangefinder."]
12355#[doc = ""]
12356#[doc = "ID: 132"]
12357#[derive(Debug, Clone, PartialEq)]
12358#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12359#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12360#[cfg_attr(feature = "ts", derive(TS))]
12361#[cfg_attr(feature = "ts", ts(export))]
12362pub struct DISTANCE_SENSOR_DATA {
12363 #[doc = "Timestamp (time since system boot)."]
12364 pub time_boot_ms: u32,
12365 #[doc = "Minimum distance the sensor can measure"]
12366 pub min_distance: u16,
12367 #[doc = "Maximum distance the sensor can measure"]
12368 pub max_distance: u16,
12369 #[doc = "Current distance reading"]
12370 pub current_distance: u16,
12371 #[doc = "Type of distance sensor."]
12372 pub mavtype: MavDistanceSensor,
12373 #[doc = "Onboard ID of the sensor"]
12374 pub id: u8,
12375 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
12376 pub orientation: MavSensorOrientation,
12377 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
12378 pub covariance: u8,
12379 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
12380 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12381 pub horizontal_fov: f32,
12382 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
12383 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12384 pub vertical_fov: f32,
12385 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
12386 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12387 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12388 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12389 pub quaternion: [f32; 4],
12390 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
12391 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12392 pub signal_quality: u8,
12393}
12394impl DISTANCE_SENSOR_DATA {
12395 pub const ENCODED_LEN: usize = 39usize;
12396 pub const DEFAULT: Self = Self {
12397 time_boot_ms: 0_u32,
12398 min_distance: 0_u16,
12399 max_distance: 0_u16,
12400 current_distance: 0_u16,
12401 mavtype: MavDistanceSensor::DEFAULT,
12402 id: 0_u8,
12403 orientation: MavSensorOrientation::DEFAULT,
12404 covariance: 0_u8,
12405 horizontal_fov: 0.0_f32,
12406 vertical_fov: 0.0_f32,
12407 quaternion: [0.0_f32; 4usize],
12408 signal_quality: 0_u8,
12409 };
12410 #[cfg(feature = "arbitrary")]
12411 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12412 use arbitrary::{Arbitrary, Unstructured};
12413 let mut buf = [0u8; 1024];
12414 rng.fill_bytes(&mut buf);
12415 let mut unstructured = Unstructured::new(&buf);
12416 Self::arbitrary(&mut unstructured).unwrap_or_default()
12417 }
12418}
12419impl Default for DISTANCE_SENSOR_DATA {
12420 fn default() -> Self {
12421 Self::DEFAULT.clone()
12422 }
12423}
12424impl MessageData for DISTANCE_SENSOR_DATA {
12425 type Message = MavMessage;
12426 const ID: u32 = 132u32;
12427 const NAME: &'static str = "DISTANCE_SENSOR";
12428 const EXTRA_CRC: u8 = 85u8;
12429 const ENCODED_LEN: usize = 39usize;
12430 fn deser(
12431 _version: MavlinkVersion,
12432 __input: &[u8],
12433 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12434 let avail_len = __input.len();
12435 let mut payload_buf = [0; Self::ENCODED_LEN];
12436 let mut buf = if avail_len < Self::ENCODED_LEN {
12437 payload_buf[0..avail_len].copy_from_slice(__input);
12438 Bytes::new(&payload_buf)
12439 } else {
12440 Bytes::new(__input)
12441 };
12442 let mut __struct = Self::default();
12443 __struct.time_boot_ms = buf.get_u32_le()?;
12444 __struct.min_distance = buf.get_u16_le()?;
12445 __struct.max_distance = buf.get_u16_le()?;
12446 __struct.current_distance = buf.get_u16_le()?;
12447 let tmp = buf.get_u8()?;
12448 __struct.mavtype =
12449 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12450 enum_type: "MavDistanceSensor",
12451 value: tmp as u64,
12452 })?;
12453 __struct.id = buf.get_u8()?;
12454 let tmp = buf.get_u8()?;
12455 __struct.orientation =
12456 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12457 enum_type: "MavSensorOrientation",
12458 value: tmp as u64,
12459 })?;
12460 __struct.covariance = buf.get_u8()?;
12461 __struct.horizontal_fov = buf.get_f32_le()?;
12462 __struct.vertical_fov = buf.get_f32_le()?;
12463 for v in &mut __struct.quaternion {
12464 let val = buf.get_f32_le()?;
12465 *v = val;
12466 }
12467 __struct.signal_quality = buf.get_u8()?;
12468 Ok(__struct)
12469 }
12470 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12471 let mut __tmp = BytesMut::new(bytes);
12472 #[allow(clippy::absurd_extreme_comparisons)]
12473 #[allow(unused_comparisons)]
12474 if __tmp.remaining() < Self::ENCODED_LEN {
12475 panic!(
12476 "buffer is too small (need {} bytes, but got {})",
12477 Self::ENCODED_LEN,
12478 __tmp.remaining(),
12479 )
12480 }
12481 __tmp.put_u32_le(self.time_boot_ms);
12482 __tmp.put_u16_le(self.min_distance);
12483 __tmp.put_u16_le(self.max_distance);
12484 __tmp.put_u16_le(self.current_distance);
12485 __tmp.put_u8(self.mavtype as u8);
12486 __tmp.put_u8(self.id);
12487 __tmp.put_u8(self.orientation as u8);
12488 __tmp.put_u8(self.covariance);
12489 if matches!(version, MavlinkVersion::V2) {
12490 __tmp.put_f32_le(self.horizontal_fov);
12491 __tmp.put_f32_le(self.vertical_fov);
12492 for val in &self.quaternion {
12493 __tmp.put_f32_le(*val);
12494 }
12495 __tmp.put_u8(self.signal_quality);
12496 let len = __tmp.len();
12497 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12498 } else {
12499 __tmp.len()
12500 }
12501 }
12502}
12503#[doc = "EFI status output."]
12504#[doc = ""]
12505#[doc = "ID: 225"]
12506#[derive(Debug, Clone, PartialEq)]
12507#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12508#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12509#[cfg_attr(feature = "ts", derive(TS))]
12510#[cfg_attr(feature = "ts", ts(export))]
12511pub struct EFI_STATUS_DATA {
12512 #[doc = "ECU index"]
12513 pub ecu_index: f32,
12514 #[doc = "RPM"]
12515 pub rpm: f32,
12516 #[doc = "Fuel consumed"]
12517 pub fuel_consumed: f32,
12518 #[doc = "Fuel flow rate"]
12519 pub fuel_flow: f32,
12520 #[doc = "Engine load"]
12521 pub engine_load: f32,
12522 #[doc = "Throttle position"]
12523 pub throttle_position: f32,
12524 #[doc = "Spark dwell time"]
12525 pub spark_dwell_time: f32,
12526 #[doc = "Barometric pressure"]
12527 pub barometric_pressure: f32,
12528 #[doc = "Intake manifold pressure("]
12529 pub intake_manifold_pressure: f32,
12530 #[doc = "Intake manifold temperature"]
12531 pub intake_manifold_temperature: f32,
12532 #[doc = "Cylinder head temperature"]
12533 pub cylinder_head_temperature: f32,
12534 #[doc = "Ignition timing (Crank angle degrees)"]
12535 pub ignition_timing: f32,
12536 #[doc = "Injection time"]
12537 pub injection_time: f32,
12538 #[doc = "Exhaust gas temperature"]
12539 pub exhaust_gas_temperature: f32,
12540 #[doc = "Output throttle"]
12541 pub throttle_out: f32,
12542 #[doc = "Pressure/temperature compensation"]
12543 pub pt_compensation: f32,
12544 #[doc = "EFI health status"]
12545 pub health: u8,
12546 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
12547 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12548 pub ignition_voltage: f32,
12549 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
12550 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12551 pub fuel_pressure: f32,
12552}
12553impl EFI_STATUS_DATA {
12554 pub const ENCODED_LEN: usize = 73usize;
12555 pub const DEFAULT: Self = Self {
12556 ecu_index: 0.0_f32,
12557 rpm: 0.0_f32,
12558 fuel_consumed: 0.0_f32,
12559 fuel_flow: 0.0_f32,
12560 engine_load: 0.0_f32,
12561 throttle_position: 0.0_f32,
12562 spark_dwell_time: 0.0_f32,
12563 barometric_pressure: 0.0_f32,
12564 intake_manifold_pressure: 0.0_f32,
12565 intake_manifold_temperature: 0.0_f32,
12566 cylinder_head_temperature: 0.0_f32,
12567 ignition_timing: 0.0_f32,
12568 injection_time: 0.0_f32,
12569 exhaust_gas_temperature: 0.0_f32,
12570 throttle_out: 0.0_f32,
12571 pt_compensation: 0.0_f32,
12572 health: 0_u8,
12573 ignition_voltage: 0.0_f32,
12574 fuel_pressure: 0.0_f32,
12575 };
12576 #[cfg(feature = "arbitrary")]
12577 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12578 use arbitrary::{Arbitrary, Unstructured};
12579 let mut buf = [0u8; 1024];
12580 rng.fill_bytes(&mut buf);
12581 let mut unstructured = Unstructured::new(&buf);
12582 Self::arbitrary(&mut unstructured).unwrap_or_default()
12583 }
12584}
12585impl Default for EFI_STATUS_DATA {
12586 fn default() -> Self {
12587 Self::DEFAULT.clone()
12588 }
12589}
12590impl MessageData for EFI_STATUS_DATA {
12591 type Message = MavMessage;
12592 const ID: u32 = 225u32;
12593 const NAME: &'static str = "EFI_STATUS";
12594 const EXTRA_CRC: u8 = 208u8;
12595 const ENCODED_LEN: usize = 73usize;
12596 fn deser(
12597 _version: MavlinkVersion,
12598 __input: &[u8],
12599 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12600 let avail_len = __input.len();
12601 let mut payload_buf = [0; Self::ENCODED_LEN];
12602 let mut buf = if avail_len < Self::ENCODED_LEN {
12603 payload_buf[0..avail_len].copy_from_slice(__input);
12604 Bytes::new(&payload_buf)
12605 } else {
12606 Bytes::new(__input)
12607 };
12608 let mut __struct = Self::default();
12609 __struct.ecu_index = buf.get_f32_le()?;
12610 __struct.rpm = buf.get_f32_le()?;
12611 __struct.fuel_consumed = buf.get_f32_le()?;
12612 __struct.fuel_flow = buf.get_f32_le()?;
12613 __struct.engine_load = buf.get_f32_le()?;
12614 __struct.throttle_position = buf.get_f32_le()?;
12615 __struct.spark_dwell_time = buf.get_f32_le()?;
12616 __struct.barometric_pressure = buf.get_f32_le()?;
12617 __struct.intake_manifold_pressure = buf.get_f32_le()?;
12618 __struct.intake_manifold_temperature = buf.get_f32_le()?;
12619 __struct.cylinder_head_temperature = buf.get_f32_le()?;
12620 __struct.ignition_timing = buf.get_f32_le()?;
12621 __struct.injection_time = buf.get_f32_le()?;
12622 __struct.exhaust_gas_temperature = buf.get_f32_le()?;
12623 __struct.throttle_out = buf.get_f32_le()?;
12624 __struct.pt_compensation = buf.get_f32_le()?;
12625 __struct.health = buf.get_u8()?;
12626 __struct.ignition_voltage = buf.get_f32_le()?;
12627 __struct.fuel_pressure = buf.get_f32_le()?;
12628 Ok(__struct)
12629 }
12630 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12631 let mut __tmp = BytesMut::new(bytes);
12632 #[allow(clippy::absurd_extreme_comparisons)]
12633 #[allow(unused_comparisons)]
12634 if __tmp.remaining() < Self::ENCODED_LEN {
12635 panic!(
12636 "buffer is too small (need {} bytes, but got {})",
12637 Self::ENCODED_LEN,
12638 __tmp.remaining(),
12639 )
12640 }
12641 __tmp.put_f32_le(self.ecu_index);
12642 __tmp.put_f32_le(self.rpm);
12643 __tmp.put_f32_le(self.fuel_consumed);
12644 __tmp.put_f32_le(self.fuel_flow);
12645 __tmp.put_f32_le(self.engine_load);
12646 __tmp.put_f32_le(self.throttle_position);
12647 __tmp.put_f32_le(self.spark_dwell_time);
12648 __tmp.put_f32_le(self.barometric_pressure);
12649 __tmp.put_f32_le(self.intake_manifold_pressure);
12650 __tmp.put_f32_le(self.intake_manifold_temperature);
12651 __tmp.put_f32_le(self.cylinder_head_temperature);
12652 __tmp.put_f32_le(self.ignition_timing);
12653 __tmp.put_f32_le(self.injection_time);
12654 __tmp.put_f32_le(self.exhaust_gas_temperature);
12655 __tmp.put_f32_le(self.throttle_out);
12656 __tmp.put_f32_le(self.pt_compensation);
12657 __tmp.put_u8(self.health);
12658 if matches!(version, MavlinkVersion::V2) {
12659 __tmp.put_f32_le(self.ignition_voltage);
12660 __tmp.put_f32_le(self.fuel_pressure);
12661 let len = __tmp.len();
12662 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12663 } else {
12664 __tmp.len()
12665 }
12666 }
12667}
12668#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
12669#[doc = ""]
12670#[doc = "ID: 131"]
12671#[derive(Debug, Clone, PartialEq)]
12672#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12674#[cfg_attr(feature = "ts", derive(TS))]
12675#[cfg_attr(feature = "ts", ts(export))]
12676pub struct ENCAPSULATED_DATA_DATA {
12677 #[doc = "sequence number (starting with 0 on every transmission)"]
12678 pub seqnr: u16,
12679 #[doc = "image data bytes"]
12680 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12681 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12682 pub data: [u8; 253],
12683}
12684impl ENCAPSULATED_DATA_DATA {
12685 pub const ENCODED_LEN: usize = 255usize;
12686 pub const DEFAULT: Self = Self {
12687 seqnr: 0_u16,
12688 data: [0_u8; 253usize],
12689 };
12690 #[cfg(feature = "arbitrary")]
12691 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12692 use arbitrary::{Arbitrary, Unstructured};
12693 let mut buf = [0u8; 1024];
12694 rng.fill_bytes(&mut buf);
12695 let mut unstructured = Unstructured::new(&buf);
12696 Self::arbitrary(&mut unstructured).unwrap_or_default()
12697 }
12698}
12699impl Default for ENCAPSULATED_DATA_DATA {
12700 fn default() -> Self {
12701 Self::DEFAULT.clone()
12702 }
12703}
12704impl MessageData for ENCAPSULATED_DATA_DATA {
12705 type Message = MavMessage;
12706 const ID: u32 = 131u32;
12707 const NAME: &'static str = "ENCAPSULATED_DATA";
12708 const EXTRA_CRC: u8 = 223u8;
12709 const ENCODED_LEN: usize = 255usize;
12710 fn deser(
12711 _version: MavlinkVersion,
12712 __input: &[u8],
12713 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12714 let avail_len = __input.len();
12715 let mut payload_buf = [0; Self::ENCODED_LEN];
12716 let mut buf = if avail_len < Self::ENCODED_LEN {
12717 payload_buf[0..avail_len].copy_from_slice(__input);
12718 Bytes::new(&payload_buf)
12719 } else {
12720 Bytes::new(__input)
12721 };
12722 let mut __struct = Self::default();
12723 __struct.seqnr = buf.get_u16_le()?;
12724 for v in &mut __struct.data {
12725 let val = buf.get_u8()?;
12726 *v = val;
12727 }
12728 Ok(__struct)
12729 }
12730 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12731 let mut __tmp = BytesMut::new(bytes);
12732 #[allow(clippy::absurd_extreme_comparisons)]
12733 #[allow(unused_comparisons)]
12734 if __tmp.remaining() < Self::ENCODED_LEN {
12735 panic!(
12736 "buffer is too small (need {} bytes, but got {})",
12737 Self::ENCODED_LEN,
12738 __tmp.remaining(),
12739 )
12740 }
12741 __tmp.put_u16_le(self.seqnr);
12742 for val in &self.data {
12743 __tmp.put_u8(*val);
12744 }
12745 if matches!(version, MavlinkVersion::V2) {
12746 let len = __tmp.len();
12747 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12748 } else {
12749 __tmp.len()
12750 }
12751 }
12752}
12753#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
12754#[doc = ""]
12755#[doc = "ID: 290"]
12756#[derive(Debug, Clone, PartialEq)]
12757#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12758#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12759#[cfg_attr(feature = "ts", derive(TS))]
12760#[cfg_attr(feature = "ts", ts(export))]
12761pub struct ESC_INFO_DATA {
12762 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
12763 pub time_usec: u64,
12764 #[doc = "Number of reported errors by each ESC since boot."]
12765 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12766 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12767 pub error_count: [u32; 4],
12768 #[doc = "Counter of data packets received."]
12769 pub counter: u16,
12770 #[doc = "Bitmap of ESC failure flags."]
12771 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12772 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12773 pub failure_flags: [u16; 4],
12774 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
12775 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12776 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12777 pub temperature: [i16; 4],
12778 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
12779 pub index: u8,
12780 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
12781 pub count: u8,
12782 #[doc = "Connection type protocol for all ESC."]
12783 pub connection_type: EscConnectionType,
12784 #[doc = "Information regarding online/offline status of each ESC."]
12785 pub info: u8,
12786}
12787impl ESC_INFO_DATA {
12788 pub const ENCODED_LEN: usize = 46usize;
12789 pub const DEFAULT: Self = Self {
12790 time_usec: 0_u64,
12791 error_count: [0_u32; 4usize],
12792 counter: 0_u16,
12793 failure_flags: [0_u16; 4usize],
12794 temperature: [0_i16; 4usize],
12795 index: 0_u8,
12796 count: 0_u8,
12797 connection_type: EscConnectionType::DEFAULT,
12798 info: 0_u8,
12799 };
12800 #[cfg(feature = "arbitrary")]
12801 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12802 use arbitrary::{Arbitrary, Unstructured};
12803 let mut buf = [0u8; 1024];
12804 rng.fill_bytes(&mut buf);
12805 let mut unstructured = Unstructured::new(&buf);
12806 Self::arbitrary(&mut unstructured).unwrap_or_default()
12807 }
12808}
12809impl Default for ESC_INFO_DATA {
12810 fn default() -> Self {
12811 Self::DEFAULT.clone()
12812 }
12813}
12814impl MessageData for ESC_INFO_DATA {
12815 type Message = MavMessage;
12816 const ID: u32 = 290u32;
12817 const NAME: &'static str = "ESC_INFO";
12818 const EXTRA_CRC: u8 = 251u8;
12819 const ENCODED_LEN: usize = 46usize;
12820 fn deser(
12821 _version: MavlinkVersion,
12822 __input: &[u8],
12823 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12824 let avail_len = __input.len();
12825 let mut payload_buf = [0; Self::ENCODED_LEN];
12826 let mut buf = if avail_len < Self::ENCODED_LEN {
12827 payload_buf[0..avail_len].copy_from_slice(__input);
12828 Bytes::new(&payload_buf)
12829 } else {
12830 Bytes::new(__input)
12831 };
12832 let mut __struct = Self::default();
12833 __struct.time_usec = buf.get_u64_le()?;
12834 for v in &mut __struct.error_count {
12835 let val = buf.get_u32_le()?;
12836 *v = val;
12837 }
12838 __struct.counter = buf.get_u16_le()?;
12839 for v in &mut __struct.failure_flags {
12840 let val = buf.get_u16_le()?;
12841 *v = val;
12842 }
12843 for v in &mut __struct.temperature {
12844 let val = buf.get_i16_le()?;
12845 *v = val;
12846 }
12847 __struct.index = buf.get_u8()?;
12848 __struct.count = buf.get_u8()?;
12849 let tmp = buf.get_u8()?;
12850 __struct.connection_type =
12851 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12852 enum_type: "EscConnectionType",
12853 value: tmp as u64,
12854 })?;
12855 __struct.info = buf.get_u8()?;
12856 Ok(__struct)
12857 }
12858 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12859 let mut __tmp = BytesMut::new(bytes);
12860 #[allow(clippy::absurd_extreme_comparisons)]
12861 #[allow(unused_comparisons)]
12862 if __tmp.remaining() < Self::ENCODED_LEN {
12863 panic!(
12864 "buffer is too small (need {} bytes, but got {})",
12865 Self::ENCODED_LEN,
12866 __tmp.remaining(),
12867 )
12868 }
12869 __tmp.put_u64_le(self.time_usec);
12870 for val in &self.error_count {
12871 __tmp.put_u32_le(*val);
12872 }
12873 __tmp.put_u16_le(self.counter);
12874 for val in &self.failure_flags {
12875 __tmp.put_u16_le(*val);
12876 }
12877 for val in &self.temperature {
12878 __tmp.put_i16_le(*val);
12879 }
12880 __tmp.put_u8(self.index);
12881 __tmp.put_u8(self.count);
12882 __tmp.put_u8(self.connection_type as u8);
12883 __tmp.put_u8(self.info);
12884 if matches!(version, MavlinkVersion::V2) {
12885 let len = __tmp.len();
12886 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12887 } else {
12888 __tmp.len()
12889 }
12890 }
12891}
12892#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
12893#[doc = ""]
12894#[doc = "ID: 291"]
12895#[derive(Debug, Clone, PartialEq)]
12896#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12897#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12898#[cfg_attr(feature = "ts", derive(TS))]
12899#[cfg_attr(feature = "ts", ts(export))]
12900pub struct ESC_STATUS_DATA {
12901 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
12902 pub time_usec: u64,
12903 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
12904 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12905 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12906 pub rpm: [i32; 4],
12907 #[doc = "Voltage measured from each ESC."]
12908 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12909 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12910 pub voltage: [f32; 4],
12911 #[doc = "Current measured from each ESC."]
12912 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12913 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12914 pub current: [f32; 4],
12915 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
12916 pub index: u8,
12917}
12918impl ESC_STATUS_DATA {
12919 pub const ENCODED_LEN: usize = 57usize;
12920 pub const DEFAULT: Self = Self {
12921 time_usec: 0_u64,
12922 rpm: [0_i32; 4usize],
12923 voltage: [0.0_f32; 4usize],
12924 current: [0.0_f32; 4usize],
12925 index: 0_u8,
12926 };
12927 #[cfg(feature = "arbitrary")]
12928 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12929 use arbitrary::{Arbitrary, Unstructured};
12930 let mut buf = [0u8; 1024];
12931 rng.fill_bytes(&mut buf);
12932 let mut unstructured = Unstructured::new(&buf);
12933 Self::arbitrary(&mut unstructured).unwrap_or_default()
12934 }
12935}
12936impl Default for ESC_STATUS_DATA {
12937 fn default() -> Self {
12938 Self::DEFAULT.clone()
12939 }
12940}
12941impl MessageData for ESC_STATUS_DATA {
12942 type Message = MavMessage;
12943 const ID: u32 = 291u32;
12944 const NAME: &'static str = "ESC_STATUS";
12945 const EXTRA_CRC: u8 = 10u8;
12946 const ENCODED_LEN: usize = 57usize;
12947 fn deser(
12948 _version: MavlinkVersion,
12949 __input: &[u8],
12950 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12951 let avail_len = __input.len();
12952 let mut payload_buf = [0; Self::ENCODED_LEN];
12953 let mut buf = if avail_len < Self::ENCODED_LEN {
12954 payload_buf[0..avail_len].copy_from_slice(__input);
12955 Bytes::new(&payload_buf)
12956 } else {
12957 Bytes::new(__input)
12958 };
12959 let mut __struct = Self::default();
12960 __struct.time_usec = buf.get_u64_le()?;
12961 for v in &mut __struct.rpm {
12962 let val = buf.get_i32_le()?;
12963 *v = val;
12964 }
12965 for v in &mut __struct.voltage {
12966 let val = buf.get_f32_le()?;
12967 *v = val;
12968 }
12969 for v in &mut __struct.current {
12970 let val = buf.get_f32_le()?;
12971 *v = val;
12972 }
12973 __struct.index = buf.get_u8()?;
12974 Ok(__struct)
12975 }
12976 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12977 let mut __tmp = BytesMut::new(bytes);
12978 #[allow(clippy::absurd_extreme_comparisons)]
12979 #[allow(unused_comparisons)]
12980 if __tmp.remaining() < Self::ENCODED_LEN {
12981 panic!(
12982 "buffer is too small (need {} bytes, but got {})",
12983 Self::ENCODED_LEN,
12984 __tmp.remaining(),
12985 )
12986 }
12987 __tmp.put_u64_le(self.time_usec);
12988 for val in &self.rpm {
12989 __tmp.put_i32_le(*val);
12990 }
12991 for val in &self.voltage {
12992 __tmp.put_f32_le(*val);
12993 }
12994 for val in &self.current {
12995 __tmp.put_f32_le(*val);
12996 }
12997 __tmp.put_u8(self.index);
12998 if matches!(version, MavlinkVersion::V2) {
12999 let len = __tmp.len();
13000 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13001 } else {
13002 __tmp.len()
13003 }
13004 }
13005}
13006#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
13007#[doc = ""]
13008#[doc = "ID: 230"]
13009#[derive(Debug, Clone, PartialEq)]
13010#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13011#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13012#[cfg_attr(feature = "ts", derive(TS))]
13013#[cfg_attr(feature = "ts", ts(export))]
13014pub struct ESTIMATOR_STATUS_DATA {
13015 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13016 pub time_usec: u64,
13017 #[doc = "Velocity innovation test ratio"]
13018 pub vel_ratio: f32,
13019 #[doc = "Horizontal position innovation test ratio"]
13020 pub pos_horiz_ratio: f32,
13021 #[doc = "Vertical position innovation test ratio"]
13022 pub pos_vert_ratio: f32,
13023 #[doc = "Magnetometer innovation test ratio"]
13024 pub mag_ratio: f32,
13025 #[doc = "Height above terrain innovation test ratio"]
13026 pub hagl_ratio: f32,
13027 #[doc = "True airspeed innovation test ratio"]
13028 pub tas_ratio: f32,
13029 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
13030 pub pos_horiz_accuracy: f32,
13031 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
13032 pub pos_vert_accuracy: f32,
13033 #[doc = "Bitmap indicating which EKF outputs are valid."]
13034 pub flags: EstimatorStatusFlags,
13035}
13036impl ESTIMATOR_STATUS_DATA {
13037 pub const ENCODED_LEN: usize = 42usize;
13038 pub const DEFAULT: Self = Self {
13039 time_usec: 0_u64,
13040 vel_ratio: 0.0_f32,
13041 pos_horiz_ratio: 0.0_f32,
13042 pos_vert_ratio: 0.0_f32,
13043 mag_ratio: 0.0_f32,
13044 hagl_ratio: 0.0_f32,
13045 tas_ratio: 0.0_f32,
13046 pos_horiz_accuracy: 0.0_f32,
13047 pos_vert_accuracy: 0.0_f32,
13048 flags: EstimatorStatusFlags::DEFAULT,
13049 };
13050 #[cfg(feature = "arbitrary")]
13051 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13052 use arbitrary::{Arbitrary, Unstructured};
13053 let mut buf = [0u8; 1024];
13054 rng.fill_bytes(&mut buf);
13055 let mut unstructured = Unstructured::new(&buf);
13056 Self::arbitrary(&mut unstructured).unwrap_or_default()
13057 }
13058}
13059impl Default for ESTIMATOR_STATUS_DATA {
13060 fn default() -> Self {
13061 Self::DEFAULT.clone()
13062 }
13063}
13064impl MessageData for ESTIMATOR_STATUS_DATA {
13065 type Message = MavMessage;
13066 const ID: u32 = 230u32;
13067 const NAME: &'static str = "ESTIMATOR_STATUS";
13068 const EXTRA_CRC: u8 = 163u8;
13069 const ENCODED_LEN: usize = 42usize;
13070 fn deser(
13071 _version: MavlinkVersion,
13072 __input: &[u8],
13073 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13074 let avail_len = __input.len();
13075 let mut payload_buf = [0; Self::ENCODED_LEN];
13076 let mut buf = if avail_len < Self::ENCODED_LEN {
13077 payload_buf[0..avail_len].copy_from_slice(__input);
13078 Bytes::new(&payload_buf)
13079 } else {
13080 Bytes::new(__input)
13081 };
13082 let mut __struct = Self::default();
13083 __struct.time_usec = buf.get_u64_le()?;
13084 __struct.vel_ratio = buf.get_f32_le()?;
13085 __struct.pos_horiz_ratio = buf.get_f32_le()?;
13086 __struct.pos_vert_ratio = buf.get_f32_le()?;
13087 __struct.mag_ratio = buf.get_f32_le()?;
13088 __struct.hagl_ratio = buf.get_f32_le()?;
13089 __struct.tas_ratio = buf.get_f32_le()?;
13090 __struct.pos_horiz_accuracy = buf.get_f32_le()?;
13091 __struct.pos_vert_accuracy = buf.get_f32_le()?;
13092 let tmp = buf.get_u16_le()?;
13093 __struct.flags = EstimatorStatusFlags::from_bits(
13094 tmp as <EstimatorStatusFlags as Flags>::Bits,
13095 )
13096 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13097 flag_type: "EstimatorStatusFlags",
13098 value: tmp as u64,
13099 })?;
13100 Ok(__struct)
13101 }
13102 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13103 let mut __tmp = BytesMut::new(bytes);
13104 #[allow(clippy::absurd_extreme_comparisons)]
13105 #[allow(unused_comparisons)]
13106 if __tmp.remaining() < Self::ENCODED_LEN {
13107 panic!(
13108 "buffer is too small (need {} bytes, but got {})",
13109 Self::ENCODED_LEN,
13110 __tmp.remaining(),
13111 )
13112 }
13113 __tmp.put_u64_le(self.time_usec);
13114 __tmp.put_f32_le(self.vel_ratio);
13115 __tmp.put_f32_le(self.pos_horiz_ratio);
13116 __tmp.put_f32_le(self.pos_vert_ratio);
13117 __tmp.put_f32_le(self.mag_ratio);
13118 __tmp.put_f32_le(self.hagl_ratio);
13119 __tmp.put_f32_le(self.tas_ratio);
13120 __tmp.put_f32_le(self.pos_horiz_accuracy);
13121 __tmp.put_f32_le(self.pos_vert_accuracy);
13122 __tmp.put_u16_le(self.flags.bits() as u16);
13123 if matches!(version, MavlinkVersion::V2) {
13124 let len = __tmp.len();
13125 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13126 } else {
13127 __tmp.len()
13128 }
13129 }
13130}
13131#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
13132#[doc = ""]
13133#[doc = "ID: 410"]
13134#[derive(Debug, Clone, PartialEq)]
13135#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13136#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13137#[cfg_attr(feature = "ts", derive(TS))]
13138#[cfg_attr(feature = "ts", ts(export))]
13139pub struct EVENT_DATA {
13140 #[doc = "Event ID (as defined in the component metadata)"]
13141 pub id: u32,
13142 #[doc = "Timestamp (time since system boot when the event happened)."]
13143 pub event_time_boot_ms: u32,
13144 #[doc = "Sequence number."]
13145 pub sequence: u16,
13146 #[doc = "Component ID"]
13147 pub destination_component: u8,
13148 #[doc = "System ID"]
13149 pub destination_system: u8,
13150 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
13151 pub log_levels: u8,
13152 #[doc = "Arguments (depend on event ID)."]
13153 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13154 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13155 pub arguments: [u8; 40],
13156}
13157impl EVENT_DATA {
13158 pub const ENCODED_LEN: usize = 53usize;
13159 pub const DEFAULT: Self = Self {
13160 id: 0_u32,
13161 event_time_boot_ms: 0_u32,
13162 sequence: 0_u16,
13163 destination_component: 0_u8,
13164 destination_system: 0_u8,
13165 log_levels: 0_u8,
13166 arguments: [0_u8; 40usize],
13167 };
13168 #[cfg(feature = "arbitrary")]
13169 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13170 use arbitrary::{Arbitrary, Unstructured};
13171 let mut buf = [0u8; 1024];
13172 rng.fill_bytes(&mut buf);
13173 let mut unstructured = Unstructured::new(&buf);
13174 Self::arbitrary(&mut unstructured).unwrap_or_default()
13175 }
13176}
13177impl Default for EVENT_DATA {
13178 fn default() -> Self {
13179 Self::DEFAULT.clone()
13180 }
13181}
13182impl MessageData for EVENT_DATA {
13183 type Message = MavMessage;
13184 const ID: u32 = 410u32;
13185 const NAME: &'static str = "EVENT";
13186 const EXTRA_CRC: u8 = 160u8;
13187 const ENCODED_LEN: usize = 53usize;
13188 fn deser(
13189 _version: MavlinkVersion,
13190 __input: &[u8],
13191 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13192 let avail_len = __input.len();
13193 let mut payload_buf = [0; Self::ENCODED_LEN];
13194 let mut buf = if avail_len < Self::ENCODED_LEN {
13195 payload_buf[0..avail_len].copy_from_slice(__input);
13196 Bytes::new(&payload_buf)
13197 } else {
13198 Bytes::new(__input)
13199 };
13200 let mut __struct = Self::default();
13201 __struct.id = buf.get_u32_le()?;
13202 __struct.event_time_boot_ms = buf.get_u32_le()?;
13203 __struct.sequence = buf.get_u16_le()?;
13204 __struct.destination_component = buf.get_u8()?;
13205 __struct.destination_system = buf.get_u8()?;
13206 __struct.log_levels = buf.get_u8()?;
13207 for v in &mut __struct.arguments {
13208 let val = buf.get_u8()?;
13209 *v = val;
13210 }
13211 Ok(__struct)
13212 }
13213 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13214 let mut __tmp = BytesMut::new(bytes);
13215 #[allow(clippy::absurd_extreme_comparisons)]
13216 #[allow(unused_comparisons)]
13217 if __tmp.remaining() < Self::ENCODED_LEN {
13218 panic!(
13219 "buffer is too small (need {} bytes, but got {})",
13220 Self::ENCODED_LEN,
13221 __tmp.remaining(),
13222 )
13223 }
13224 __tmp.put_u32_le(self.id);
13225 __tmp.put_u32_le(self.event_time_boot_ms);
13226 __tmp.put_u16_le(self.sequence);
13227 __tmp.put_u8(self.destination_component);
13228 __tmp.put_u8(self.destination_system);
13229 __tmp.put_u8(self.log_levels);
13230 for val in &self.arguments {
13231 __tmp.put_u8(*val);
13232 }
13233 if matches!(version, MavlinkVersion::V2) {
13234 let len = __tmp.len();
13235 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13236 } else {
13237 __tmp.len()
13238 }
13239 }
13240}
13241#[doc = "Provides state for additional features."]
13242#[doc = ""]
13243#[doc = "ID: 245"]
13244#[derive(Debug, Clone, PartialEq)]
13245#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13246#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13247#[cfg_attr(feature = "ts", derive(TS))]
13248#[cfg_attr(feature = "ts", ts(export))]
13249pub struct EXTENDED_SYS_STATE_DATA {
13250 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
13251 pub vtol_state: MavVtolState,
13252 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
13253 pub landed_state: MavLandedState,
13254}
13255impl EXTENDED_SYS_STATE_DATA {
13256 pub const ENCODED_LEN: usize = 2usize;
13257 pub const DEFAULT: Self = Self {
13258 vtol_state: MavVtolState::DEFAULT,
13259 landed_state: MavLandedState::DEFAULT,
13260 };
13261 #[cfg(feature = "arbitrary")]
13262 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13263 use arbitrary::{Arbitrary, Unstructured};
13264 let mut buf = [0u8; 1024];
13265 rng.fill_bytes(&mut buf);
13266 let mut unstructured = Unstructured::new(&buf);
13267 Self::arbitrary(&mut unstructured).unwrap_or_default()
13268 }
13269}
13270impl Default for EXTENDED_SYS_STATE_DATA {
13271 fn default() -> Self {
13272 Self::DEFAULT.clone()
13273 }
13274}
13275impl MessageData for EXTENDED_SYS_STATE_DATA {
13276 type Message = MavMessage;
13277 const ID: u32 = 245u32;
13278 const NAME: &'static str = "EXTENDED_SYS_STATE";
13279 const EXTRA_CRC: u8 = 130u8;
13280 const ENCODED_LEN: usize = 2usize;
13281 fn deser(
13282 _version: MavlinkVersion,
13283 __input: &[u8],
13284 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13285 let avail_len = __input.len();
13286 let mut payload_buf = [0; Self::ENCODED_LEN];
13287 let mut buf = if avail_len < Self::ENCODED_LEN {
13288 payload_buf[0..avail_len].copy_from_slice(__input);
13289 Bytes::new(&payload_buf)
13290 } else {
13291 Bytes::new(__input)
13292 };
13293 let mut __struct = Self::default();
13294 let tmp = buf.get_u8()?;
13295 __struct.vtol_state =
13296 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13297 enum_type: "MavVtolState",
13298 value: tmp as u64,
13299 })?;
13300 let tmp = buf.get_u8()?;
13301 __struct.landed_state =
13302 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13303 enum_type: "MavLandedState",
13304 value: tmp as u64,
13305 })?;
13306 Ok(__struct)
13307 }
13308 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13309 let mut __tmp = BytesMut::new(bytes);
13310 #[allow(clippy::absurd_extreme_comparisons)]
13311 #[allow(unused_comparisons)]
13312 if __tmp.remaining() < Self::ENCODED_LEN {
13313 panic!(
13314 "buffer is too small (need {} bytes, but got {})",
13315 Self::ENCODED_LEN,
13316 __tmp.remaining(),
13317 )
13318 }
13319 __tmp.put_u8(self.vtol_state as u8);
13320 __tmp.put_u8(self.landed_state as u8);
13321 if matches!(version, MavlinkVersion::V2) {
13322 let len = __tmp.len();
13323 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13324 } else {
13325 __tmp.len()
13326 }
13327 }
13328}
13329#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
13330#[doc = ""]
13331#[doc = "ID: 162"]
13332#[derive(Debug, Clone, PartialEq)]
13333#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13334#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13335#[cfg_attr(feature = "ts", derive(TS))]
13336#[cfg_attr(feature = "ts", ts(export))]
13337pub struct FENCE_STATUS_DATA {
13338 #[doc = "Time (since boot) of last breach."]
13339 pub breach_time: u32,
13340 #[doc = "Number of fence breaches."]
13341 pub breach_count: u16,
13342 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
13343 pub breach_status: u8,
13344 #[doc = "Last breach type."]
13345 pub breach_type: FenceBreach,
13346 #[doc = "Active action to prevent fence breach"]
13347 #[cfg_attr(feature = "serde", serde(default))]
13348 pub breach_mitigation: FenceMitigate,
13349}
13350impl FENCE_STATUS_DATA {
13351 pub const ENCODED_LEN: usize = 9usize;
13352 pub const DEFAULT: Self = Self {
13353 breach_time: 0_u32,
13354 breach_count: 0_u16,
13355 breach_status: 0_u8,
13356 breach_type: FenceBreach::DEFAULT,
13357 breach_mitigation: FenceMitigate::DEFAULT,
13358 };
13359 #[cfg(feature = "arbitrary")]
13360 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13361 use arbitrary::{Arbitrary, Unstructured};
13362 let mut buf = [0u8; 1024];
13363 rng.fill_bytes(&mut buf);
13364 let mut unstructured = Unstructured::new(&buf);
13365 Self::arbitrary(&mut unstructured).unwrap_or_default()
13366 }
13367}
13368impl Default for FENCE_STATUS_DATA {
13369 fn default() -> Self {
13370 Self::DEFAULT.clone()
13371 }
13372}
13373impl MessageData for FENCE_STATUS_DATA {
13374 type Message = MavMessage;
13375 const ID: u32 = 162u32;
13376 const NAME: &'static str = "FENCE_STATUS";
13377 const EXTRA_CRC: u8 = 189u8;
13378 const ENCODED_LEN: usize = 9usize;
13379 fn deser(
13380 _version: MavlinkVersion,
13381 __input: &[u8],
13382 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13383 let avail_len = __input.len();
13384 let mut payload_buf = [0; Self::ENCODED_LEN];
13385 let mut buf = if avail_len < Self::ENCODED_LEN {
13386 payload_buf[0..avail_len].copy_from_slice(__input);
13387 Bytes::new(&payload_buf)
13388 } else {
13389 Bytes::new(__input)
13390 };
13391 let mut __struct = Self::default();
13392 __struct.breach_time = buf.get_u32_le()?;
13393 __struct.breach_count = buf.get_u16_le()?;
13394 __struct.breach_status = buf.get_u8()?;
13395 let tmp = buf.get_u8()?;
13396 __struct.breach_type =
13397 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13398 enum_type: "FenceBreach",
13399 value: tmp as u64,
13400 })?;
13401 let tmp = buf.get_u8()?;
13402 __struct.breach_mitigation =
13403 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13404 enum_type: "FenceMitigate",
13405 value: tmp as u64,
13406 })?;
13407 Ok(__struct)
13408 }
13409 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13410 let mut __tmp = BytesMut::new(bytes);
13411 #[allow(clippy::absurd_extreme_comparisons)]
13412 #[allow(unused_comparisons)]
13413 if __tmp.remaining() < Self::ENCODED_LEN {
13414 panic!(
13415 "buffer is too small (need {} bytes, but got {})",
13416 Self::ENCODED_LEN,
13417 __tmp.remaining(),
13418 )
13419 }
13420 __tmp.put_u32_le(self.breach_time);
13421 __tmp.put_u16_le(self.breach_count);
13422 __tmp.put_u8(self.breach_status);
13423 __tmp.put_u8(self.breach_type as u8);
13424 if matches!(version, MavlinkVersion::V2) {
13425 __tmp.put_u8(self.breach_mitigation as u8);
13426 let len = __tmp.len();
13427 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13428 } else {
13429 __tmp.len()
13430 }
13431 }
13432}
13433#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
13434#[doc = ""]
13435#[doc = "ID: 110"]
13436#[derive(Debug, Clone, PartialEq)]
13437#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13438#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13439#[cfg_attr(feature = "ts", derive(TS))]
13440#[cfg_attr(feature = "ts", ts(export))]
13441pub struct FILE_TRANSFER_PROTOCOL_DATA {
13442 #[doc = "Network ID (0 for broadcast)"]
13443 pub target_network: u8,
13444 #[doc = "System ID (0 for broadcast)"]
13445 pub target_system: u8,
13446 #[doc = "Component ID (0 for broadcast)"]
13447 pub target_component: u8,
13448 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
13449 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13450 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13451 pub payload: [u8; 251],
13452}
13453impl FILE_TRANSFER_PROTOCOL_DATA {
13454 pub const ENCODED_LEN: usize = 254usize;
13455 pub const DEFAULT: Self = Self {
13456 target_network: 0_u8,
13457 target_system: 0_u8,
13458 target_component: 0_u8,
13459 payload: [0_u8; 251usize],
13460 };
13461 #[cfg(feature = "arbitrary")]
13462 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13463 use arbitrary::{Arbitrary, Unstructured};
13464 let mut buf = [0u8; 1024];
13465 rng.fill_bytes(&mut buf);
13466 let mut unstructured = Unstructured::new(&buf);
13467 Self::arbitrary(&mut unstructured).unwrap_or_default()
13468 }
13469}
13470impl Default for FILE_TRANSFER_PROTOCOL_DATA {
13471 fn default() -> Self {
13472 Self::DEFAULT.clone()
13473 }
13474}
13475impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
13476 type Message = MavMessage;
13477 const ID: u32 = 110u32;
13478 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
13479 const EXTRA_CRC: u8 = 84u8;
13480 const ENCODED_LEN: usize = 254usize;
13481 fn deser(
13482 _version: MavlinkVersion,
13483 __input: &[u8],
13484 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13485 let avail_len = __input.len();
13486 let mut payload_buf = [0; Self::ENCODED_LEN];
13487 let mut buf = if avail_len < Self::ENCODED_LEN {
13488 payload_buf[0..avail_len].copy_from_slice(__input);
13489 Bytes::new(&payload_buf)
13490 } else {
13491 Bytes::new(__input)
13492 };
13493 let mut __struct = Self::default();
13494 __struct.target_network = buf.get_u8()?;
13495 __struct.target_system = buf.get_u8()?;
13496 __struct.target_component = buf.get_u8()?;
13497 for v in &mut __struct.payload {
13498 let val = buf.get_u8()?;
13499 *v = val;
13500 }
13501 Ok(__struct)
13502 }
13503 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13504 let mut __tmp = BytesMut::new(bytes);
13505 #[allow(clippy::absurd_extreme_comparisons)]
13506 #[allow(unused_comparisons)]
13507 if __tmp.remaining() < Self::ENCODED_LEN {
13508 panic!(
13509 "buffer is too small (need {} bytes, but got {})",
13510 Self::ENCODED_LEN,
13511 __tmp.remaining(),
13512 )
13513 }
13514 __tmp.put_u8(self.target_network);
13515 __tmp.put_u8(self.target_system);
13516 __tmp.put_u8(self.target_component);
13517 for val in &self.payload {
13518 __tmp.put_u8(*val);
13519 }
13520 if matches!(version, MavlinkVersion::V2) {
13521 let len = __tmp.len();
13522 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13523 } else {
13524 __tmp.len()
13525 }
13526 }
13527}
13528#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
13529#[doc = ""]
13530#[doc = "ID: 264"]
13531#[derive(Debug, Clone, PartialEq)]
13532#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13533#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13534#[cfg_attr(feature = "ts", derive(TS))]
13535#[cfg_attr(feature = "ts", ts(export))]
13536pub struct FLIGHT_INFORMATION_DATA {
13537 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
13538 pub arming_time_utc: u64,
13539 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
13540 pub takeoff_time_utc: u64,
13541 #[doc = "Flight number. Note, field is misnamed UUID."]
13542 pub flight_uuid: u64,
13543 #[doc = "Timestamp (time since system boot)."]
13544 pub time_boot_ms: u32,
13545 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
13546 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13547 pub landing_time: u32,
13548}
13549impl FLIGHT_INFORMATION_DATA {
13550 pub const ENCODED_LEN: usize = 32usize;
13551 pub const DEFAULT: Self = Self {
13552 arming_time_utc: 0_u64,
13553 takeoff_time_utc: 0_u64,
13554 flight_uuid: 0_u64,
13555 time_boot_ms: 0_u32,
13556 landing_time: 0_u32,
13557 };
13558 #[cfg(feature = "arbitrary")]
13559 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13560 use arbitrary::{Arbitrary, Unstructured};
13561 let mut buf = [0u8; 1024];
13562 rng.fill_bytes(&mut buf);
13563 let mut unstructured = Unstructured::new(&buf);
13564 Self::arbitrary(&mut unstructured).unwrap_or_default()
13565 }
13566}
13567impl Default for FLIGHT_INFORMATION_DATA {
13568 fn default() -> Self {
13569 Self::DEFAULT.clone()
13570 }
13571}
13572impl MessageData for FLIGHT_INFORMATION_DATA {
13573 type Message = MavMessage;
13574 const ID: u32 = 264u32;
13575 const NAME: &'static str = "FLIGHT_INFORMATION";
13576 const EXTRA_CRC: u8 = 49u8;
13577 const ENCODED_LEN: usize = 32usize;
13578 fn deser(
13579 _version: MavlinkVersion,
13580 __input: &[u8],
13581 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13582 let avail_len = __input.len();
13583 let mut payload_buf = [0; Self::ENCODED_LEN];
13584 let mut buf = if avail_len < Self::ENCODED_LEN {
13585 payload_buf[0..avail_len].copy_from_slice(__input);
13586 Bytes::new(&payload_buf)
13587 } else {
13588 Bytes::new(__input)
13589 };
13590 let mut __struct = Self::default();
13591 __struct.arming_time_utc = buf.get_u64_le()?;
13592 __struct.takeoff_time_utc = buf.get_u64_le()?;
13593 __struct.flight_uuid = buf.get_u64_le()?;
13594 __struct.time_boot_ms = buf.get_u32_le()?;
13595 __struct.landing_time = buf.get_u32_le()?;
13596 Ok(__struct)
13597 }
13598 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13599 let mut __tmp = BytesMut::new(bytes);
13600 #[allow(clippy::absurd_extreme_comparisons)]
13601 #[allow(unused_comparisons)]
13602 if __tmp.remaining() < Self::ENCODED_LEN {
13603 panic!(
13604 "buffer is too small (need {} bytes, but got {})",
13605 Self::ENCODED_LEN,
13606 __tmp.remaining(),
13607 )
13608 }
13609 __tmp.put_u64_le(self.arming_time_utc);
13610 __tmp.put_u64_le(self.takeoff_time_utc);
13611 __tmp.put_u64_le(self.flight_uuid);
13612 __tmp.put_u32_le(self.time_boot_ms);
13613 if matches!(version, MavlinkVersion::V2) {
13614 __tmp.put_u32_le(self.landing_time);
13615 let len = __tmp.len();
13616 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13617 } else {
13618 __tmp.len()
13619 }
13620 }
13621}
13622#[doc = "Current motion information from a designated system."]
13623#[doc = ""]
13624#[doc = "ID: 144"]
13625#[derive(Debug, Clone, PartialEq)]
13626#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13627#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13628#[cfg_attr(feature = "ts", derive(TS))]
13629#[cfg_attr(feature = "ts", ts(export))]
13630pub struct FOLLOW_TARGET_DATA {
13631 #[doc = "Timestamp (time since system boot)."]
13632 pub timestamp: u64,
13633 #[doc = "button states or switches of a tracker device"]
13634 pub custom_state: u64,
13635 #[doc = "Latitude (WGS84)"]
13636 pub lat: i32,
13637 #[doc = "Longitude (WGS84)"]
13638 pub lon: i32,
13639 #[doc = "Altitude (MSL)"]
13640 pub alt: f32,
13641 #[doc = "target velocity (0,0,0) for unknown"]
13642 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13643 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13644 pub vel: [f32; 3],
13645 #[doc = "linear target acceleration (0,0,0) for unknown"]
13646 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13647 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13648 pub acc: [f32; 3],
13649 #[doc = "(0 0 0 0 for unknown)"]
13650 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13651 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13652 pub attitude_q: [f32; 4],
13653 #[doc = "(0 0 0 for unknown)"]
13654 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13655 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13656 pub rates: [f32; 3],
13657 #[doc = "eph epv"]
13658 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13659 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13660 pub position_cov: [f32; 3],
13661 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
13662 pub est_capabilities: u8,
13663}
13664impl FOLLOW_TARGET_DATA {
13665 pub const ENCODED_LEN: usize = 93usize;
13666 pub const DEFAULT: Self = Self {
13667 timestamp: 0_u64,
13668 custom_state: 0_u64,
13669 lat: 0_i32,
13670 lon: 0_i32,
13671 alt: 0.0_f32,
13672 vel: [0.0_f32; 3usize],
13673 acc: [0.0_f32; 3usize],
13674 attitude_q: [0.0_f32; 4usize],
13675 rates: [0.0_f32; 3usize],
13676 position_cov: [0.0_f32; 3usize],
13677 est_capabilities: 0_u8,
13678 };
13679 #[cfg(feature = "arbitrary")]
13680 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13681 use arbitrary::{Arbitrary, Unstructured};
13682 let mut buf = [0u8; 1024];
13683 rng.fill_bytes(&mut buf);
13684 let mut unstructured = Unstructured::new(&buf);
13685 Self::arbitrary(&mut unstructured).unwrap_or_default()
13686 }
13687}
13688impl Default for FOLLOW_TARGET_DATA {
13689 fn default() -> Self {
13690 Self::DEFAULT.clone()
13691 }
13692}
13693impl MessageData for FOLLOW_TARGET_DATA {
13694 type Message = MavMessage;
13695 const ID: u32 = 144u32;
13696 const NAME: &'static str = "FOLLOW_TARGET";
13697 const EXTRA_CRC: u8 = 127u8;
13698 const ENCODED_LEN: usize = 93usize;
13699 fn deser(
13700 _version: MavlinkVersion,
13701 __input: &[u8],
13702 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13703 let avail_len = __input.len();
13704 let mut payload_buf = [0; Self::ENCODED_LEN];
13705 let mut buf = if avail_len < Self::ENCODED_LEN {
13706 payload_buf[0..avail_len].copy_from_slice(__input);
13707 Bytes::new(&payload_buf)
13708 } else {
13709 Bytes::new(__input)
13710 };
13711 let mut __struct = Self::default();
13712 __struct.timestamp = buf.get_u64_le()?;
13713 __struct.custom_state = buf.get_u64_le()?;
13714 __struct.lat = buf.get_i32_le()?;
13715 __struct.lon = buf.get_i32_le()?;
13716 __struct.alt = buf.get_f32_le()?;
13717 for v in &mut __struct.vel {
13718 let val = buf.get_f32_le()?;
13719 *v = val;
13720 }
13721 for v in &mut __struct.acc {
13722 let val = buf.get_f32_le()?;
13723 *v = val;
13724 }
13725 for v in &mut __struct.attitude_q {
13726 let val = buf.get_f32_le()?;
13727 *v = val;
13728 }
13729 for v in &mut __struct.rates {
13730 let val = buf.get_f32_le()?;
13731 *v = val;
13732 }
13733 for v in &mut __struct.position_cov {
13734 let val = buf.get_f32_le()?;
13735 *v = val;
13736 }
13737 __struct.est_capabilities = buf.get_u8()?;
13738 Ok(__struct)
13739 }
13740 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13741 let mut __tmp = BytesMut::new(bytes);
13742 #[allow(clippy::absurd_extreme_comparisons)]
13743 #[allow(unused_comparisons)]
13744 if __tmp.remaining() < Self::ENCODED_LEN {
13745 panic!(
13746 "buffer is too small (need {} bytes, but got {})",
13747 Self::ENCODED_LEN,
13748 __tmp.remaining(),
13749 )
13750 }
13751 __tmp.put_u64_le(self.timestamp);
13752 __tmp.put_u64_le(self.custom_state);
13753 __tmp.put_i32_le(self.lat);
13754 __tmp.put_i32_le(self.lon);
13755 __tmp.put_f32_le(self.alt);
13756 for val in &self.vel {
13757 __tmp.put_f32_le(*val);
13758 }
13759 for val in &self.acc {
13760 __tmp.put_f32_le(*val);
13761 }
13762 for val in &self.attitude_q {
13763 __tmp.put_f32_le(*val);
13764 }
13765 for val in &self.rates {
13766 __tmp.put_f32_le(*val);
13767 }
13768 for val in &self.position_cov {
13769 __tmp.put_f32_le(*val);
13770 }
13771 __tmp.put_u8(self.est_capabilities);
13772 if matches!(version, MavlinkVersion::V2) {
13773 let len = __tmp.len();
13774 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13775 } else {
13776 __tmp.len()
13777 }
13778 }
13779}
13780#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
13781#[doc = ""]
13782#[doc = "ID: 371"]
13783#[derive(Debug, Clone, PartialEq)]
13784#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13785#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13786#[cfg_attr(feature = "ts", derive(TS))]
13787#[cfg_attr(feature = "ts", ts(export))]
13788pub struct FUEL_STATUS_DATA {
13789 #[doc = "Capacity when full. Must be provided."]
13790 pub maximum_fuel: f32,
13791 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
13792 pub consumed_fuel: f32,
13793 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
13794 pub remaining_fuel: f32,
13795 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
13796 pub flow_rate: f32,
13797 #[doc = "Fuel temperature. NaN: field not provided."]
13798 pub temperature: f32,
13799 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
13800 pub fuel_type: MavFuelType,
13801 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
13802 pub id: u8,
13803 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
13804 pub percent_remaining: u8,
13805}
13806impl FUEL_STATUS_DATA {
13807 pub const ENCODED_LEN: usize = 26usize;
13808 pub const DEFAULT: Self = Self {
13809 maximum_fuel: 0.0_f32,
13810 consumed_fuel: 0.0_f32,
13811 remaining_fuel: 0.0_f32,
13812 flow_rate: 0.0_f32,
13813 temperature: 0.0_f32,
13814 fuel_type: MavFuelType::DEFAULT,
13815 id: 0_u8,
13816 percent_remaining: 0_u8,
13817 };
13818 #[cfg(feature = "arbitrary")]
13819 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13820 use arbitrary::{Arbitrary, Unstructured};
13821 let mut buf = [0u8; 1024];
13822 rng.fill_bytes(&mut buf);
13823 let mut unstructured = Unstructured::new(&buf);
13824 Self::arbitrary(&mut unstructured).unwrap_or_default()
13825 }
13826}
13827impl Default for FUEL_STATUS_DATA {
13828 fn default() -> Self {
13829 Self::DEFAULT.clone()
13830 }
13831}
13832impl MessageData for FUEL_STATUS_DATA {
13833 type Message = MavMessage;
13834 const ID: u32 = 371u32;
13835 const NAME: &'static str = "FUEL_STATUS";
13836 const EXTRA_CRC: u8 = 10u8;
13837 const ENCODED_LEN: usize = 26usize;
13838 fn deser(
13839 _version: MavlinkVersion,
13840 __input: &[u8],
13841 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13842 let avail_len = __input.len();
13843 let mut payload_buf = [0; Self::ENCODED_LEN];
13844 let mut buf = if avail_len < Self::ENCODED_LEN {
13845 payload_buf[0..avail_len].copy_from_slice(__input);
13846 Bytes::new(&payload_buf)
13847 } else {
13848 Bytes::new(__input)
13849 };
13850 let mut __struct = Self::default();
13851 __struct.maximum_fuel = buf.get_f32_le()?;
13852 __struct.consumed_fuel = buf.get_f32_le()?;
13853 __struct.remaining_fuel = buf.get_f32_le()?;
13854 __struct.flow_rate = buf.get_f32_le()?;
13855 __struct.temperature = buf.get_f32_le()?;
13856 let tmp = buf.get_u32_le()?;
13857 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
13858 ::mavlink_core::error::ParserError::InvalidEnum {
13859 enum_type: "MavFuelType",
13860 value: tmp as u64,
13861 },
13862 )?;
13863 __struct.id = buf.get_u8()?;
13864 __struct.percent_remaining = buf.get_u8()?;
13865 Ok(__struct)
13866 }
13867 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13868 let mut __tmp = BytesMut::new(bytes);
13869 #[allow(clippy::absurd_extreme_comparisons)]
13870 #[allow(unused_comparisons)]
13871 if __tmp.remaining() < Self::ENCODED_LEN {
13872 panic!(
13873 "buffer is too small (need {} bytes, but got {})",
13874 Self::ENCODED_LEN,
13875 __tmp.remaining(),
13876 )
13877 }
13878 __tmp.put_f32_le(self.maximum_fuel);
13879 __tmp.put_f32_le(self.consumed_fuel);
13880 __tmp.put_f32_le(self.remaining_fuel);
13881 __tmp.put_f32_le(self.flow_rate);
13882 __tmp.put_f32_le(self.temperature);
13883 __tmp.put_u32_le(self.fuel_type as u32);
13884 __tmp.put_u8(self.id);
13885 __tmp.put_u8(self.percent_remaining);
13886 if matches!(version, MavlinkVersion::V2) {
13887 let len = __tmp.len();
13888 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13889 } else {
13890 __tmp.len()
13891 }
13892 }
13893}
13894#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
13895#[doc = ""]
13896#[doc = "ID: 373"]
13897#[derive(Debug, Clone, PartialEq)]
13898#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13899#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13900#[cfg_attr(feature = "ts", derive(TS))]
13901#[cfg_attr(feature = "ts", ts(export))]
13902pub struct GENERATOR_STATUS_DATA {
13903 #[doc = "Status flags."]
13904 pub status: MavGeneratorStatusFlag,
13905 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
13906 pub battery_current: f32,
13907 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
13908 pub load_current: f32,
13909 #[doc = "The power being generated. NaN: field not provided"]
13910 pub power_generated: f32,
13911 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
13912 pub bus_voltage: f32,
13913 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
13914 pub bat_current_setpoint: f32,
13915 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
13916 pub runtime: u32,
13917 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
13918 pub time_until_maintenance: i32,
13919 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
13920 pub generator_speed: u16,
13921 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
13922 pub rectifier_temperature: i16,
13923 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
13924 pub generator_temperature: i16,
13925}
13926impl GENERATOR_STATUS_DATA {
13927 pub const ENCODED_LEN: usize = 42usize;
13928 pub const DEFAULT: Self = Self {
13929 status: MavGeneratorStatusFlag::DEFAULT,
13930 battery_current: 0.0_f32,
13931 load_current: 0.0_f32,
13932 power_generated: 0.0_f32,
13933 bus_voltage: 0.0_f32,
13934 bat_current_setpoint: 0.0_f32,
13935 runtime: 0_u32,
13936 time_until_maintenance: 0_i32,
13937 generator_speed: 0_u16,
13938 rectifier_temperature: 0_i16,
13939 generator_temperature: 0_i16,
13940 };
13941 #[cfg(feature = "arbitrary")]
13942 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13943 use arbitrary::{Arbitrary, Unstructured};
13944 let mut buf = [0u8; 1024];
13945 rng.fill_bytes(&mut buf);
13946 let mut unstructured = Unstructured::new(&buf);
13947 Self::arbitrary(&mut unstructured).unwrap_or_default()
13948 }
13949}
13950impl Default for GENERATOR_STATUS_DATA {
13951 fn default() -> Self {
13952 Self::DEFAULT.clone()
13953 }
13954}
13955impl MessageData for GENERATOR_STATUS_DATA {
13956 type Message = MavMessage;
13957 const ID: u32 = 373u32;
13958 const NAME: &'static str = "GENERATOR_STATUS";
13959 const EXTRA_CRC: u8 = 117u8;
13960 const ENCODED_LEN: usize = 42usize;
13961 fn deser(
13962 _version: MavlinkVersion,
13963 __input: &[u8],
13964 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13965 let avail_len = __input.len();
13966 let mut payload_buf = [0; Self::ENCODED_LEN];
13967 let mut buf = if avail_len < Self::ENCODED_LEN {
13968 payload_buf[0..avail_len].copy_from_slice(__input);
13969 Bytes::new(&payload_buf)
13970 } else {
13971 Bytes::new(__input)
13972 };
13973 let mut __struct = Self::default();
13974 let tmp = buf.get_u64_le()?;
13975 __struct.status =
13976 MavGeneratorStatusFlag::from_bits(tmp as <MavGeneratorStatusFlag as Flags>::Bits)
13977 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13978 flag_type: "MavGeneratorStatusFlag",
13979 value: tmp as u64,
13980 })?;
13981 __struct.battery_current = buf.get_f32_le()?;
13982 __struct.load_current = buf.get_f32_le()?;
13983 __struct.power_generated = buf.get_f32_le()?;
13984 __struct.bus_voltage = buf.get_f32_le()?;
13985 __struct.bat_current_setpoint = buf.get_f32_le()?;
13986 __struct.runtime = buf.get_u32_le()?;
13987 __struct.time_until_maintenance = buf.get_i32_le()?;
13988 __struct.generator_speed = buf.get_u16_le()?;
13989 __struct.rectifier_temperature = buf.get_i16_le()?;
13990 __struct.generator_temperature = buf.get_i16_le()?;
13991 Ok(__struct)
13992 }
13993 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13994 let mut __tmp = BytesMut::new(bytes);
13995 #[allow(clippy::absurd_extreme_comparisons)]
13996 #[allow(unused_comparisons)]
13997 if __tmp.remaining() < Self::ENCODED_LEN {
13998 panic!(
13999 "buffer is too small (need {} bytes, but got {})",
14000 Self::ENCODED_LEN,
14001 __tmp.remaining(),
14002 )
14003 }
14004 __tmp.put_u64_le(self.status.bits() as u64);
14005 __tmp.put_f32_le(self.battery_current);
14006 __tmp.put_f32_le(self.load_current);
14007 __tmp.put_f32_le(self.power_generated);
14008 __tmp.put_f32_le(self.bus_voltage);
14009 __tmp.put_f32_le(self.bat_current_setpoint);
14010 __tmp.put_u32_le(self.runtime);
14011 __tmp.put_i32_le(self.time_until_maintenance);
14012 __tmp.put_u16_le(self.generator_speed);
14013 __tmp.put_i16_le(self.rectifier_temperature);
14014 __tmp.put_i16_le(self.generator_temperature);
14015 if matches!(version, MavlinkVersion::V2) {
14016 let len = __tmp.len();
14017 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14018 } else {
14019 __tmp.len()
14020 }
14021 }
14022}
14023#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
14024#[doc = ""]
14025#[doc = "ID: 285"]
14026#[derive(Debug, Clone, PartialEq)]
14027#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14028#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14029#[cfg_attr(feature = "ts", derive(TS))]
14030#[cfg_attr(feature = "ts", ts(export))]
14031pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
14032 #[doc = "Timestamp (time since system boot)."]
14033 pub time_boot_ms: u32,
14034 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
14035 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14036 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14037 pub q: [f32; 4],
14038 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
14039 pub angular_velocity_x: f32,
14040 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
14041 pub angular_velocity_y: f32,
14042 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
14043 pub angular_velocity_z: f32,
14044 #[doc = "Failure flags (0 for no failure)"]
14045 pub failure_flags: GimbalDeviceErrorFlags,
14046 #[doc = "Current gimbal flags set."]
14047 pub flags: GimbalDeviceFlags,
14048 #[doc = "System ID"]
14049 pub target_system: u8,
14050 #[doc = "Component ID"]
14051 pub target_component: u8,
14052 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
14053 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14054 pub delta_yaw: f32,
14055 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
14056 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14057 pub delta_yaw_velocity: f32,
14058 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
14059 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14060 pub gimbal_device_id: u8,
14061}
14062impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
14063 pub const ENCODED_LEN: usize = 49usize;
14064 pub const DEFAULT: Self = Self {
14065 time_boot_ms: 0_u32,
14066 q: [0.0_f32; 4usize],
14067 angular_velocity_x: 0.0_f32,
14068 angular_velocity_y: 0.0_f32,
14069 angular_velocity_z: 0.0_f32,
14070 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
14071 flags: GimbalDeviceFlags::DEFAULT,
14072 target_system: 0_u8,
14073 target_component: 0_u8,
14074 delta_yaw: 0.0_f32,
14075 delta_yaw_velocity: 0.0_f32,
14076 gimbal_device_id: 0_u8,
14077 };
14078 #[cfg(feature = "arbitrary")]
14079 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14080 use arbitrary::{Arbitrary, Unstructured};
14081 let mut buf = [0u8; 1024];
14082 rng.fill_bytes(&mut buf);
14083 let mut unstructured = Unstructured::new(&buf);
14084 Self::arbitrary(&mut unstructured).unwrap_or_default()
14085 }
14086}
14087impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
14088 fn default() -> Self {
14089 Self::DEFAULT.clone()
14090 }
14091}
14092impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
14093 type Message = MavMessage;
14094 const ID: u32 = 285u32;
14095 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
14096 const EXTRA_CRC: u8 = 137u8;
14097 const ENCODED_LEN: usize = 49usize;
14098 fn deser(
14099 _version: MavlinkVersion,
14100 __input: &[u8],
14101 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14102 let avail_len = __input.len();
14103 let mut payload_buf = [0; Self::ENCODED_LEN];
14104 let mut buf = if avail_len < Self::ENCODED_LEN {
14105 payload_buf[0..avail_len].copy_from_slice(__input);
14106 Bytes::new(&payload_buf)
14107 } else {
14108 Bytes::new(__input)
14109 };
14110 let mut __struct = Self::default();
14111 __struct.time_boot_ms = buf.get_u32_le()?;
14112 for v in &mut __struct.q {
14113 let val = buf.get_f32_le()?;
14114 *v = val;
14115 }
14116 __struct.angular_velocity_x = buf.get_f32_le()?;
14117 __struct.angular_velocity_y = buf.get_f32_le()?;
14118 __struct.angular_velocity_z = buf.get_f32_le()?;
14119 let tmp = buf.get_u32_le()?;
14120 __struct.failure_flags =
14121 GimbalDeviceErrorFlags::from_bits(tmp as <GimbalDeviceErrorFlags as Flags>::Bits)
14122 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14123 flag_type: "GimbalDeviceErrorFlags",
14124 value: tmp as u64,
14125 })?;
14126 let tmp = buf.get_u16_le()?;
14127 __struct.flags = GimbalDeviceFlags::from_bits(tmp as <GimbalDeviceFlags as Flags>::Bits)
14128 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14129 flag_type: "GimbalDeviceFlags",
14130 value: tmp as u64,
14131 })?;
14132 __struct.target_system = buf.get_u8()?;
14133 __struct.target_component = buf.get_u8()?;
14134 __struct.delta_yaw = buf.get_f32_le()?;
14135 __struct.delta_yaw_velocity = buf.get_f32_le()?;
14136 __struct.gimbal_device_id = buf.get_u8()?;
14137 Ok(__struct)
14138 }
14139 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14140 let mut __tmp = BytesMut::new(bytes);
14141 #[allow(clippy::absurd_extreme_comparisons)]
14142 #[allow(unused_comparisons)]
14143 if __tmp.remaining() < Self::ENCODED_LEN {
14144 panic!(
14145 "buffer is too small (need {} bytes, but got {})",
14146 Self::ENCODED_LEN,
14147 __tmp.remaining(),
14148 )
14149 }
14150 __tmp.put_u32_le(self.time_boot_ms);
14151 for val in &self.q {
14152 __tmp.put_f32_le(*val);
14153 }
14154 __tmp.put_f32_le(self.angular_velocity_x);
14155 __tmp.put_f32_le(self.angular_velocity_y);
14156 __tmp.put_f32_le(self.angular_velocity_z);
14157 __tmp.put_u32_le(self.failure_flags.bits() as u32);
14158 __tmp.put_u16_le(self.flags.bits() as u16);
14159 __tmp.put_u8(self.target_system);
14160 __tmp.put_u8(self.target_component);
14161 if matches!(version, MavlinkVersion::V2) {
14162 __tmp.put_f32_le(self.delta_yaw);
14163 __tmp.put_f32_le(self.delta_yaw_velocity);
14164 __tmp.put_u8(self.gimbal_device_id);
14165 let len = __tmp.len();
14166 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14167 } else {
14168 __tmp.len()
14169 }
14170 }
14171}
14172#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
14173#[doc = ""]
14174#[doc = "ID: 283"]
14175#[derive(Debug, Clone, PartialEq)]
14176#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14177#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14178#[cfg_attr(feature = "ts", derive(TS))]
14179#[cfg_attr(feature = "ts", ts(export))]
14180pub struct GIMBAL_DEVICE_INFORMATION_DATA {
14181 #[doc = "UID of gimbal hardware (0 if unknown)."]
14182 pub uid: u64,
14183 #[doc = "Timestamp (time since system boot)."]
14184 pub time_boot_ms: u32,
14185 #[doc = "Version of the gimbal firmware, encoded as: (Dev&0xff)<<24 | (Patch&0xff)<<16 | (Minor&0xff)<<8 | (Major&0xff)."]
14186 pub firmware_version: u32,
14187 #[doc = "Version of the gimbal hardware, encoded as: (Dev&0xff)<<24 | (Patch&0xff)<<16 | (Minor&0xff)<<8 | (Major&0xff)."]
14188 pub hardware_version: u32,
14189 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
14190 pub roll_min: f32,
14191 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
14192 pub roll_max: f32,
14193 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
14194 pub pitch_min: f32,
14195 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
14196 pub pitch_max: f32,
14197 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
14198 pub yaw_min: f32,
14199 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
14200 pub yaw_max: f32,
14201 #[doc = "Bitmap of gimbal capability flags."]
14202 pub cap_flags: GimbalDeviceCapFlags,
14203 #[doc = "Bitmap for use for gimbal-specific capability flags."]
14204 pub custom_cap_flags: u16,
14205 #[doc = "Name of the gimbal vendor."]
14206 #[cfg_attr(feature = "ts", ts(type = "string"))]
14207 pub vendor_name: CharArray<32>,
14208 #[doc = "Name of the gimbal model."]
14209 #[cfg_attr(feature = "ts", ts(type = "string"))]
14210 pub model_name: CharArray<32>,
14211 #[doc = "Custom name of the gimbal given to it by the user."]
14212 #[cfg_attr(feature = "ts", ts(type = "string"))]
14213 pub custom_name: CharArray<32>,
14214 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
14215 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14216 pub gimbal_device_id: u8,
14217}
14218impl GIMBAL_DEVICE_INFORMATION_DATA {
14219 pub const ENCODED_LEN: usize = 145usize;
14220 pub const DEFAULT: Self = Self {
14221 uid: 0_u64,
14222 time_boot_ms: 0_u32,
14223 firmware_version: 0_u32,
14224 hardware_version: 0_u32,
14225 roll_min: 0.0_f32,
14226 roll_max: 0.0_f32,
14227 pitch_min: 0.0_f32,
14228 pitch_max: 0.0_f32,
14229 yaw_min: 0.0_f32,
14230 yaw_max: 0.0_f32,
14231 cap_flags: GimbalDeviceCapFlags::DEFAULT,
14232 custom_cap_flags: 0_u16,
14233 vendor_name: CharArray::new([0_u8; 32usize]),
14234 model_name: CharArray::new([0_u8; 32usize]),
14235 custom_name: CharArray::new([0_u8; 32usize]),
14236 gimbal_device_id: 0_u8,
14237 };
14238 #[cfg(feature = "arbitrary")]
14239 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14240 use arbitrary::{Arbitrary, Unstructured};
14241 let mut buf = [0u8; 1024];
14242 rng.fill_bytes(&mut buf);
14243 let mut unstructured = Unstructured::new(&buf);
14244 Self::arbitrary(&mut unstructured).unwrap_or_default()
14245 }
14246}
14247impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
14248 fn default() -> Self {
14249 Self::DEFAULT.clone()
14250 }
14251}
14252impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
14253 type Message = MavMessage;
14254 const ID: u32 = 283u32;
14255 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
14256 const EXTRA_CRC: u8 = 74u8;
14257 const ENCODED_LEN: usize = 145usize;
14258 fn deser(
14259 _version: MavlinkVersion,
14260 __input: &[u8],
14261 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14262 let avail_len = __input.len();
14263 let mut payload_buf = [0; Self::ENCODED_LEN];
14264 let mut buf = if avail_len < Self::ENCODED_LEN {
14265 payload_buf[0..avail_len].copy_from_slice(__input);
14266 Bytes::new(&payload_buf)
14267 } else {
14268 Bytes::new(__input)
14269 };
14270 let mut __struct = Self::default();
14271 __struct.uid = buf.get_u64_le()?;
14272 __struct.time_boot_ms = buf.get_u32_le()?;
14273 __struct.firmware_version = buf.get_u32_le()?;
14274 __struct.hardware_version = buf.get_u32_le()?;
14275 __struct.roll_min = buf.get_f32_le()?;
14276 __struct.roll_max = buf.get_f32_le()?;
14277 __struct.pitch_min = buf.get_f32_le()?;
14278 __struct.pitch_max = buf.get_f32_le()?;
14279 __struct.yaw_min = buf.get_f32_le()?;
14280 __struct.yaw_max = buf.get_f32_le()?;
14281 let tmp = buf.get_u16_le()?;
14282 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
14283 tmp as <GimbalDeviceCapFlags as Flags>::Bits,
14284 )
14285 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14286 flag_type: "GimbalDeviceCapFlags",
14287 value: tmp as u64,
14288 })?;
14289 __struct.custom_cap_flags = buf.get_u16_le()?;
14290 let mut tmp = [0_u8; 32usize];
14291 for v in &mut tmp {
14292 *v = buf.get_u8()?;
14293 }
14294 __struct.vendor_name = CharArray::new(tmp);
14295 let mut tmp = [0_u8; 32usize];
14296 for v in &mut tmp {
14297 *v = buf.get_u8()?;
14298 }
14299 __struct.model_name = CharArray::new(tmp);
14300 let mut tmp = [0_u8; 32usize];
14301 for v in &mut tmp {
14302 *v = buf.get_u8()?;
14303 }
14304 __struct.custom_name = CharArray::new(tmp);
14305 __struct.gimbal_device_id = buf.get_u8()?;
14306 Ok(__struct)
14307 }
14308 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14309 let mut __tmp = BytesMut::new(bytes);
14310 #[allow(clippy::absurd_extreme_comparisons)]
14311 #[allow(unused_comparisons)]
14312 if __tmp.remaining() < Self::ENCODED_LEN {
14313 panic!(
14314 "buffer is too small (need {} bytes, but got {})",
14315 Self::ENCODED_LEN,
14316 __tmp.remaining(),
14317 )
14318 }
14319 __tmp.put_u64_le(self.uid);
14320 __tmp.put_u32_le(self.time_boot_ms);
14321 __tmp.put_u32_le(self.firmware_version);
14322 __tmp.put_u32_le(self.hardware_version);
14323 __tmp.put_f32_le(self.roll_min);
14324 __tmp.put_f32_le(self.roll_max);
14325 __tmp.put_f32_le(self.pitch_min);
14326 __tmp.put_f32_le(self.pitch_max);
14327 __tmp.put_f32_le(self.yaw_min);
14328 __tmp.put_f32_le(self.yaw_max);
14329 __tmp.put_u16_le(self.cap_flags.bits() as u16);
14330 __tmp.put_u16_le(self.custom_cap_flags);
14331 for val in &self.vendor_name {
14332 __tmp.put_u8(*val);
14333 }
14334 for val in &self.model_name {
14335 __tmp.put_u8(*val);
14336 }
14337 for val in &self.custom_name {
14338 __tmp.put_u8(*val);
14339 }
14340 if matches!(version, MavlinkVersion::V2) {
14341 __tmp.put_u8(self.gimbal_device_id);
14342 let len = __tmp.len();
14343 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14344 } else {
14345 __tmp.len()
14346 }
14347 }
14348}
14349#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
14350#[doc = ""]
14351#[doc = "ID: 284"]
14352#[derive(Debug, Clone, PartialEq)]
14353#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14354#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14355#[cfg_attr(feature = "ts", derive(TS))]
14356#[cfg_attr(feature = "ts", ts(export))]
14357pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
14358 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
14359 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14360 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14361 pub q: [f32; 4],
14362 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
14363 pub angular_velocity_x: f32,
14364 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
14365 pub angular_velocity_y: f32,
14366 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
14367 pub angular_velocity_z: f32,
14368 #[doc = "Low level gimbal flags."]
14369 pub flags: GimbalDeviceFlags,
14370 #[doc = "System ID"]
14371 pub target_system: u8,
14372 #[doc = "Component ID"]
14373 pub target_component: u8,
14374}
14375impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
14376 pub const ENCODED_LEN: usize = 32usize;
14377 pub const DEFAULT: Self = Self {
14378 q: [0.0_f32; 4usize],
14379 angular_velocity_x: 0.0_f32,
14380 angular_velocity_y: 0.0_f32,
14381 angular_velocity_z: 0.0_f32,
14382 flags: GimbalDeviceFlags::DEFAULT,
14383 target_system: 0_u8,
14384 target_component: 0_u8,
14385 };
14386 #[cfg(feature = "arbitrary")]
14387 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14388 use arbitrary::{Arbitrary, Unstructured};
14389 let mut buf = [0u8; 1024];
14390 rng.fill_bytes(&mut buf);
14391 let mut unstructured = Unstructured::new(&buf);
14392 Self::arbitrary(&mut unstructured).unwrap_or_default()
14393 }
14394}
14395impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
14396 fn default() -> Self {
14397 Self::DEFAULT.clone()
14398 }
14399}
14400impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
14401 type Message = MavMessage;
14402 const ID: u32 = 284u32;
14403 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
14404 const EXTRA_CRC: u8 = 99u8;
14405 const ENCODED_LEN: usize = 32usize;
14406 fn deser(
14407 _version: MavlinkVersion,
14408 __input: &[u8],
14409 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14410 let avail_len = __input.len();
14411 let mut payload_buf = [0; Self::ENCODED_LEN];
14412 let mut buf = if avail_len < Self::ENCODED_LEN {
14413 payload_buf[0..avail_len].copy_from_slice(__input);
14414 Bytes::new(&payload_buf)
14415 } else {
14416 Bytes::new(__input)
14417 };
14418 let mut __struct = Self::default();
14419 for v in &mut __struct.q {
14420 let val = buf.get_f32_le()?;
14421 *v = val;
14422 }
14423 __struct.angular_velocity_x = buf.get_f32_le()?;
14424 __struct.angular_velocity_y = buf.get_f32_le()?;
14425 __struct.angular_velocity_z = buf.get_f32_le()?;
14426 let tmp = buf.get_u16_le()?;
14427 __struct.flags = GimbalDeviceFlags::from_bits(tmp as <GimbalDeviceFlags as Flags>::Bits)
14428 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14429 flag_type: "GimbalDeviceFlags",
14430 value: tmp as u64,
14431 })?;
14432 __struct.target_system = buf.get_u8()?;
14433 __struct.target_component = buf.get_u8()?;
14434 Ok(__struct)
14435 }
14436 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14437 let mut __tmp = BytesMut::new(bytes);
14438 #[allow(clippy::absurd_extreme_comparisons)]
14439 #[allow(unused_comparisons)]
14440 if __tmp.remaining() < Self::ENCODED_LEN {
14441 panic!(
14442 "buffer is too small (need {} bytes, but got {})",
14443 Self::ENCODED_LEN,
14444 __tmp.remaining(),
14445 )
14446 }
14447 for val in &self.q {
14448 __tmp.put_f32_le(*val);
14449 }
14450 __tmp.put_f32_le(self.angular_velocity_x);
14451 __tmp.put_f32_le(self.angular_velocity_y);
14452 __tmp.put_f32_le(self.angular_velocity_z);
14453 __tmp.put_u16_le(self.flags.bits() as u16);
14454 __tmp.put_u8(self.target_system);
14455 __tmp.put_u8(self.target_component);
14456 if matches!(version, MavlinkVersion::V2) {
14457 let len = __tmp.len();
14458 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14459 } else {
14460 __tmp.len()
14461 }
14462 }
14463}
14464#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
14465#[doc = ""]
14466#[doc = "ID: 280"]
14467#[derive(Debug, Clone, PartialEq)]
14468#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14469#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14470#[cfg_attr(feature = "ts", derive(TS))]
14471#[cfg_attr(feature = "ts", ts(export))]
14472pub struct GIMBAL_MANAGER_INFORMATION_DATA {
14473 #[doc = "Timestamp (time since system boot)."]
14474 pub time_boot_ms: u32,
14475 #[doc = "Bitmap of gimbal capability flags."]
14476 pub cap_flags: GimbalManagerCapFlags,
14477 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
14478 pub roll_min: f32,
14479 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
14480 pub roll_max: f32,
14481 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
14482 pub pitch_min: f32,
14483 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
14484 pub pitch_max: f32,
14485 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
14486 pub yaw_min: f32,
14487 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
14488 pub yaw_max: f32,
14489 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
14490 pub gimbal_device_id: u8,
14491}
14492impl GIMBAL_MANAGER_INFORMATION_DATA {
14493 pub const ENCODED_LEN: usize = 33usize;
14494 pub const DEFAULT: Self = Self {
14495 time_boot_ms: 0_u32,
14496 cap_flags: GimbalManagerCapFlags::DEFAULT,
14497 roll_min: 0.0_f32,
14498 roll_max: 0.0_f32,
14499 pitch_min: 0.0_f32,
14500 pitch_max: 0.0_f32,
14501 yaw_min: 0.0_f32,
14502 yaw_max: 0.0_f32,
14503 gimbal_device_id: 0_u8,
14504 };
14505 #[cfg(feature = "arbitrary")]
14506 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14507 use arbitrary::{Arbitrary, Unstructured};
14508 let mut buf = [0u8; 1024];
14509 rng.fill_bytes(&mut buf);
14510 let mut unstructured = Unstructured::new(&buf);
14511 Self::arbitrary(&mut unstructured).unwrap_or_default()
14512 }
14513}
14514impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
14515 fn default() -> Self {
14516 Self::DEFAULT.clone()
14517 }
14518}
14519impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
14520 type Message = MavMessage;
14521 const ID: u32 = 280u32;
14522 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
14523 const EXTRA_CRC: u8 = 70u8;
14524 const ENCODED_LEN: usize = 33usize;
14525 fn deser(
14526 _version: MavlinkVersion,
14527 __input: &[u8],
14528 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14529 let avail_len = __input.len();
14530 let mut payload_buf = [0; Self::ENCODED_LEN];
14531 let mut buf = if avail_len < Self::ENCODED_LEN {
14532 payload_buf[0..avail_len].copy_from_slice(__input);
14533 Bytes::new(&payload_buf)
14534 } else {
14535 Bytes::new(__input)
14536 };
14537 let mut __struct = Self::default();
14538 __struct.time_boot_ms = buf.get_u32_le()?;
14539 let tmp = buf.get_u32_le()?;
14540 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
14541 tmp as <GimbalManagerCapFlags as Flags>::Bits,
14542 )
14543 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14544 flag_type: "GimbalManagerCapFlags",
14545 value: tmp as u64,
14546 })?;
14547 __struct.roll_min = buf.get_f32_le()?;
14548 __struct.roll_max = buf.get_f32_le()?;
14549 __struct.pitch_min = buf.get_f32_le()?;
14550 __struct.pitch_max = buf.get_f32_le()?;
14551 __struct.yaw_min = buf.get_f32_le()?;
14552 __struct.yaw_max = buf.get_f32_le()?;
14553 __struct.gimbal_device_id = buf.get_u8()?;
14554 Ok(__struct)
14555 }
14556 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14557 let mut __tmp = BytesMut::new(bytes);
14558 #[allow(clippy::absurd_extreme_comparisons)]
14559 #[allow(unused_comparisons)]
14560 if __tmp.remaining() < Self::ENCODED_LEN {
14561 panic!(
14562 "buffer is too small (need {} bytes, but got {})",
14563 Self::ENCODED_LEN,
14564 __tmp.remaining(),
14565 )
14566 }
14567 __tmp.put_u32_le(self.time_boot_ms);
14568 __tmp.put_u32_le(self.cap_flags.bits() as u32);
14569 __tmp.put_f32_le(self.roll_min);
14570 __tmp.put_f32_le(self.roll_max);
14571 __tmp.put_f32_le(self.pitch_min);
14572 __tmp.put_f32_le(self.pitch_max);
14573 __tmp.put_f32_le(self.yaw_min);
14574 __tmp.put_f32_le(self.yaw_max);
14575 __tmp.put_u8(self.gimbal_device_id);
14576 if matches!(version, MavlinkVersion::V2) {
14577 let len = __tmp.len();
14578 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14579 } else {
14580 __tmp.len()
14581 }
14582 }
14583}
14584#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
14585#[doc = ""]
14586#[doc = "ID: 282"]
14587#[derive(Debug, Clone, PartialEq)]
14588#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14589#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14590#[cfg_attr(feature = "ts", derive(TS))]
14591#[cfg_attr(feature = "ts", ts(export))]
14592pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
14593 #[doc = "High level gimbal manager flags to use."]
14594 pub flags: GimbalManagerFlags,
14595 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
14596 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14597 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14598 pub q: [f32; 4],
14599 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
14600 pub angular_velocity_x: f32,
14601 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
14602 pub angular_velocity_y: f32,
14603 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
14604 pub angular_velocity_z: f32,
14605 #[doc = "System ID"]
14606 pub target_system: u8,
14607 #[doc = "Component ID"]
14608 pub target_component: u8,
14609 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
14610 pub gimbal_device_id: u8,
14611}
14612impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
14613 pub const ENCODED_LEN: usize = 35usize;
14614 pub const DEFAULT: Self = Self {
14615 flags: GimbalManagerFlags::DEFAULT,
14616 q: [0.0_f32; 4usize],
14617 angular_velocity_x: 0.0_f32,
14618 angular_velocity_y: 0.0_f32,
14619 angular_velocity_z: 0.0_f32,
14620 target_system: 0_u8,
14621 target_component: 0_u8,
14622 gimbal_device_id: 0_u8,
14623 };
14624 #[cfg(feature = "arbitrary")]
14625 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14626 use arbitrary::{Arbitrary, Unstructured};
14627 let mut buf = [0u8; 1024];
14628 rng.fill_bytes(&mut buf);
14629 let mut unstructured = Unstructured::new(&buf);
14630 Self::arbitrary(&mut unstructured).unwrap_or_default()
14631 }
14632}
14633impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
14634 fn default() -> Self {
14635 Self::DEFAULT.clone()
14636 }
14637}
14638impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
14639 type Message = MavMessage;
14640 const ID: u32 = 282u32;
14641 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
14642 const EXTRA_CRC: u8 = 123u8;
14643 const ENCODED_LEN: usize = 35usize;
14644 fn deser(
14645 _version: MavlinkVersion,
14646 __input: &[u8],
14647 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14648 let avail_len = __input.len();
14649 let mut payload_buf = [0; Self::ENCODED_LEN];
14650 let mut buf = if avail_len < Self::ENCODED_LEN {
14651 payload_buf[0..avail_len].copy_from_slice(__input);
14652 Bytes::new(&payload_buf)
14653 } else {
14654 Bytes::new(__input)
14655 };
14656 let mut __struct = Self::default();
14657 let tmp = buf.get_u32_le()?;
14658 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
14659 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14660 flag_type: "GimbalManagerFlags",
14661 value: tmp as u64,
14662 })?;
14663 for v in &mut __struct.q {
14664 let val = buf.get_f32_le()?;
14665 *v = val;
14666 }
14667 __struct.angular_velocity_x = buf.get_f32_le()?;
14668 __struct.angular_velocity_y = buf.get_f32_le()?;
14669 __struct.angular_velocity_z = buf.get_f32_le()?;
14670 __struct.target_system = buf.get_u8()?;
14671 __struct.target_component = buf.get_u8()?;
14672 __struct.gimbal_device_id = buf.get_u8()?;
14673 Ok(__struct)
14674 }
14675 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14676 let mut __tmp = BytesMut::new(bytes);
14677 #[allow(clippy::absurd_extreme_comparisons)]
14678 #[allow(unused_comparisons)]
14679 if __tmp.remaining() < Self::ENCODED_LEN {
14680 panic!(
14681 "buffer is too small (need {} bytes, but got {})",
14682 Self::ENCODED_LEN,
14683 __tmp.remaining(),
14684 )
14685 }
14686 __tmp.put_u32_le(self.flags.bits() as u32);
14687 for val in &self.q {
14688 __tmp.put_f32_le(*val);
14689 }
14690 __tmp.put_f32_le(self.angular_velocity_x);
14691 __tmp.put_f32_le(self.angular_velocity_y);
14692 __tmp.put_f32_le(self.angular_velocity_z);
14693 __tmp.put_u8(self.target_system);
14694 __tmp.put_u8(self.target_component);
14695 __tmp.put_u8(self.gimbal_device_id);
14696 if matches!(version, MavlinkVersion::V2) {
14697 let len = __tmp.len();
14698 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14699 } else {
14700 __tmp.len()
14701 }
14702 }
14703}
14704#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
14705#[doc = ""]
14706#[doc = "ID: 288"]
14707#[derive(Debug, Clone, PartialEq)]
14708#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14709#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14710#[cfg_attr(feature = "ts", derive(TS))]
14711#[cfg_attr(feature = "ts", ts(export))]
14712pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
14713 #[doc = "High level gimbal manager flags."]
14714 pub flags: GimbalManagerFlags,
14715 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
14716 pub pitch: f32,
14717 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
14718 pub yaw: f32,
14719 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
14720 pub pitch_rate: f32,
14721 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
14722 pub yaw_rate: f32,
14723 #[doc = "System ID"]
14724 pub target_system: u8,
14725 #[doc = "Component ID"]
14726 pub target_component: u8,
14727 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
14728 pub gimbal_device_id: u8,
14729}
14730impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
14731 pub const ENCODED_LEN: usize = 23usize;
14732 pub const DEFAULT: Self = Self {
14733 flags: GimbalManagerFlags::DEFAULT,
14734 pitch: 0.0_f32,
14735 yaw: 0.0_f32,
14736 pitch_rate: 0.0_f32,
14737 yaw_rate: 0.0_f32,
14738 target_system: 0_u8,
14739 target_component: 0_u8,
14740 gimbal_device_id: 0_u8,
14741 };
14742 #[cfg(feature = "arbitrary")]
14743 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14744 use arbitrary::{Arbitrary, Unstructured};
14745 let mut buf = [0u8; 1024];
14746 rng.fill_bytes(&mut buf);
14747 let mut unstructured = Unstructured::new(&buf);
14748 Self::arbitrary(&mut unstructured).unwrap_or_default()
14749 }
14750}
14751impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
14752 fn default() -> Self {
14753 Self::DEFAULT.clone()
14754 }
14755}
14756impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
14757 type Message = MavMessage;
14758 const ID: u32 = 288u32;
14759 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
14760 const EXTRA_CRC: u8 = 20u8;
14761 const ENCODED_LEN: usize = 23usize;
14762 fn deser(
14763 _version: MavlinkVersion,
14764 __input: &[u8],
14765 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14766 let avail_len = __input.len();
14767 let mut payload_buf = [0; Self::ENCODED_LEN];
14768 let mut buf = if avail_len < Self::ENCODED_LEN {
14769 payload_buf[0..avail_len].copy_from_slice(__input);
14770 Bytes::new(&payload_buf)
14771 } else {
14772 Bytes::new(__input)
14773 };
14774 let mut __struct = Self::default();
14775 let tmp = buf.get_u32_le()?;
14776 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
14777 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14778 flag_type: "GimbalManagerFlags",
14779 value: tmp as u64,
14780 })?;
14781 __struct.pitch = buf.get_f32_le()?;
14782 __struct.yaw = buf.get_f32_le()?;
14783 __struct.pitch_rate = buf.get_f32_le()?;
14784 __struct.yaw_rate = buf.get_f32_le()?;
14785 __struct.target_system = buf.get_u8()?;
14786 __struct.target_component = buf.get_u8()?;
14787 __struct.gimbal_device_id = buf.get_u8()?;
14788 Ok(__struct)
14789 }
14790 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14791 let mut __tmp = BytesMut::new(bytes);
14792 #[allow(clippy::absurd_extreme_comparisons)]
14793 #[allow(unused_comparisons)]
14794 if __tmp.remaining() < Self::ENCODED_LEN {
14795 panic!(
14796 "buffer is too small (need {} bytes, but got {})",
14797 Self::ENCODED_LEN,
14798 __tmp.remaining(),
14799 )
14800 }
14801 __tmp.put_u32_le(self.flags.bits() as u32);
14802 __tmp.put_f32_le(self.pitch);
14803 __tmp.put_f32_le(self.yaw);
14804 __tmp.put_f32_le(self.pitch_rate);
14805 __tmp.put_f32_le(self.yaw_rate);
14806 __tmp.put_u8(self.target_system);
14807 __tmp.put_u8(self.target_component);
14808 __tmp.put_u8(self.gimbal_device_id);
14809 if matches!(version, MavlinkVersion::V2) {
14810 let len = __tmp.len();
14811 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14812 } else {
14813 __tmp.len()
14814 }
14815 }
14816}
14817#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
14818#[doc = ""]
14819#[doc = "ID: 287"]
14820#[derive(Debug, Clone, PartialEq)]
14821#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14822#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14823#[cfg_attr(feature = "ts", derive(TS))]
14824#[cfg_attr(feature = "ts", ts(export))]
14825pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
14826 #[doc = "High level gimbal manager flags to use."]
14827 pub flags: GimbalManagerFlags,
14828 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
14829 pub pitch: f32,
14830 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
14831 pub yaw: f32,
14832 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
14833 pub pitch_rate: f32,
14834 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
14835 pub yaw_rate: f32,
14836 #[doc = "System ID"]
14837 pub target_system: u8,
14838 #[doc = "Component ID"]
14839 pub target_component: u8,
14840 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
14841 pub gimbal_device_id: u8,
14842}
14843impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
14844 pub const ENCODED_LEN: usize = 23usize;
14845 pub const DEFAULT: Self = Self {
14846 flags: GimbalManagerFlags::DEFAULT,
14847 pitch: 0.0_f32,
14848 yaw: 0.0_f32,
14849 pitch_rate: 0.0_f32,
14850 yaw_rate: 0.0_f32,
14851 target_system: 0_u8,
14852 target_component: 0_u8,
14853 gimbal_device_id: 0_u8,
14854 };
14855 #[cfg(feature = "arbitrary")]
14856 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14857 use arbitrary::{Arbitrary, Unstructured};
14858 let mut buf = [0u8; 1024];
14859 rng.fill_bytes(&mut buf);
14860 let mut unstructured = Unstructured::new(&buf);
14861 Self::arbitrary(&mut unstructured).unwrap_or_default()
14862 }
14863}
14864impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
14865 fn default() -> Self {
14866 Self::DEFAULT.clone()
14867 }
14868}
14869impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
14870 type Message = MavMessage;
14871 const ID: u32 = 287u32;
14872 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
14873 const EXTRA_CRC: u8 = 1u8;
14874 const ENCODED_LEN: usize = 23usize;
14875 fn deser(
14876 _version: MavlinkVersion,
14877 __input: &[u8],
14878 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14879 let avail_len = __input.len();
14880 let mut payload_buf = [0; Self::ENCODED_LEN];
14881 let mut buf = if avail_len < Self::ENCODED_LEN {
14882 payload_buf[0..avail_len].copy_from_slice(__input);
14883 Bytes::new(&payload_buf)
14884 } else {
14885 Bytes::new(__input)
14886 };
14887 let mut __struct = Self::default();
14888 let tmp = buf.get_u32_le()?;
14889 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
14890 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14891 flag_type: "GimbalManagerFlags",
14892 value: tmp as u64,
14893 })?;
14894 __struct.pitch = buf.get_f32_le()?;
14895 __struct.yaw = buf.get_f32_le()?;
14896 __struct.pitch_rate = buf.get_f32_le()?;
14897 __struct.yaw_rate = buf.get_f32_le()?;
14898 __struct.target_system = buf.get_u8()?;
14899 __struct.target_component = buf.get_u8()?;
14900 __struct.gimbal_device_id = buf.get_u8()?;
14901 Ok(__struct)
14902 }
14903 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14904 let mut __tmp = BytesMut::new(bytes);
14905 #[allow(clippy::absurd_extreme_comparisons)]
14906 #[allow(unused_comparisons)]
14907 if __tmp.remaining() < Self::ENCODED_LEN {
14908 panic!(
14909 "buffer is too small (need {} bytes, but got {})",
14910 Self::ENCODED_LEN,
14911 __tmp.remaining(),
14912 )
14913 }
14914 __tmp.put_u32_le(self.flags.bits() as u32);
14915 __tmp.put_f32_le(self.pitch);
14916 __tmp.put_f32_le(self.yaw);
14917 __tmp.put_f32_le(self.pitch_rate);
14918 __tmp.put_f32_le(self.yaw_rate);
14919 __tmp.put_u8(self.target_system);
14920 __tmp.put_u8(self.target_component);
14921 __tmp.put_u8(self.gimbal_device_id);
14922 if matches!(version, MavlinkVersion::V2) {
14923 let len = __tmp.len();
14924 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14925 } else {
14926 __tmp.len()
14927 }
14928 }
14929}
14930#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
14931#[doc = ""]
14932#[doc = "ID: 281"]
14933#[derive(Debug, Clone, PartialEq)]
14934#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14935#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14936#[cfg_attr(feature = "ts", derive(TS))]
14937#[cfg_attr(feature = "ts", ts(export))]
14938pub struct GIMBAL_MANAGER_STATUS_DATA {
14939 #[doc = "Timestamp (time since system boot)."]
14940 pub time_boot_ms: u32,
14941 #[doc = "High level gimbal manager flags currently applied."]
14942 pub flags: GimbalManagerFlags,
14943 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
14944 pub gimbal_device_id: u8,
14945 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
14946 pub primary_control_sysid: u8,
14947 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
14948 pub primary_control_compid: u8,
14949 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
14950 pub secondary_control_sysid: u8,
14951 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
14952 pub secondary_control_compid: u8,
14953}
14954impl GIMBAL_MANAGER_STATUS_DATA {
14955 pub const ENCODED_LEN: usize = 13usize;
14956 pub const DEFAULT: Self = Self {
14957 time_boot_ms: 0_u32,
14958 flags: GimbalManagerFlags::DEFAULT,
14959 gimbal_device_id: 0_u8,
14960 primary_control_sysid: 0_u8,
14961 primary_control_compid: 0_u8,
14962 secondary_control_sysid: 0_u8,
14963 secondary_control_compid: 0_u8,
14964 };
14965 #[cfg(feature = "arbitrary")]
14966 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14967 use arbitrary::{Arbitrary, Unstructured};
14968 let mut buf = [0u8; 1024];
14969 rng.fill_bytes(&mut buf);
14970 let mut unstructured = Unstructured::new(&buf);
14971 Self::arbitrary(&mut unstructured).unwrap_or_default()
14972 }
14973}
14974impl Default for GIMBAL_MANAGER_STATUS_DATA {
14975 fn default() -> Self {
14976 Self::DEFAULT.clone()
14977 }
14978}
14979impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
14980 type Message = MavMessage;
14981 const ID: u32 = 281u32;
14982 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
14983 const EXTRA_CRC: u8 = 48u8;
14984 const ENCODED_LEN: usize = 13usize;
14985 fn deser(
14986 _version: MavlinkVersion,
14987 __input: &[u8],
14988 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14989 let avail_len = __input.len();
14990 let mut payload_buf = [0; Self::ENCODED_LEN];
14991 let mut buf = if avail_len < Self::ENCODED_LEN {
14992 payload_buf[0..avail_len].copy_from_slice(__input);
14993 Bytes::new(&payload_buf)
14994 } else {
14995 Bytes::new(__input)
14996 };
14997 let mut __struct = Self::default();
14998 __struct.time_boot_ms = buf.get_u32_le()?;
14999 let tmp = buf.get_u32_le()?;
15000 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
15001 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15002 flag_type: "GimbalManagerFlags",
15003 value: tmp as u64,
15004 })?;
15005 __struct.gimbal_device_id = buf.get_u8()?;
15006 __struct.primary_control_sysid = buf.get_u8()?;
15007 __struct.primary_control_compid = buf.get_u8()?;
15008 __struct.secondary_control_sysid = buf.get_u8()?;
15009 __struct.secondary_control_compid = buf.get_u8()?;
15010 Ok(__struct)
15011 }
15012 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15013 let mut __tmp = BytesMut::new(bytes);
15014 #[allow(clippy::absurd_extreme_comparisons)]
15015 #[allow(unused_comparisons)]
15016 if __tmp.remaining() < Self::ENCODED_LEN {
15017 panic!(
15018 "buffer is too small (need {} bytes, but got {})",
15019 Self::ENCODED_LEN,
15020 __tmp.remaining(),
15021 )
15022 }
15023 __tmp.put_u32_le(self.time_boot_ms);
15024 __tmp.put_u32_le(self.flags.bits() as u32);
15025 __tmp.put_u8(self.gimbal_device_id);
15026 __tmp.put_u8(self.primary_control_sysid);
15027 __tmp.put_u8(self.primary_control_compid);
15028 __tmp.put_u8(self.secondary_control_sysid);
15029 __tmp.put_u8(self.secondary_control_compid);
15030 if matches!(version, MavlinkVersion::V2) {
15031 let len = __tmp.len();
15032 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15033 } else {
15034 __tmp.len()
15035 }
15036 }
15037}
15038#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
15039#[doc = ""]
15040#[doc = "ID: 33"]
15041#[derive(Debug, Clone, PartialEq)]
15042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15043#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15044#[cfg_attr(feature = "ts", derive(TS))]
15045#[cfg_attr(feature = "ts", ts(export))]
15046pub struct GLOBAL_POSITION_INT_DATA {
15047 #[doc = "Timestamp (time since system boot)."]
15048 pub time_boot_ms: u32,
15049 #[doc = "Latitude, expressed"]
15050 pub lat: i32,
15051 #[doc = "Longitude, expressed"]
15052 pub lon: i32,
15053 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
15054 pub alt: i32,
15055 #[doc = "Altitude above home"]
15056 pub relative_alt: i32,
15057 #[doc = "Ground X Speed (Latitude, positive north)"]
15058 pub vx: i16,
15059 #[doc = "Ground Y Speed (Longitude, positive east)"]
15060 pub vy: i16,
15061 #[doc = "Ground Z Speed (Altitude, positive down)"]
15062 pub vz: i16,
15063 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15064 pub hdg: u16,
15065}
15066impl GLOBAL_POSITION_INT_DATA {
15067 pub const ENCODED_LEN: usize = 28usize;
15068 pub const DEFAULT: Self = Self {
15069 time_boot_ms: 0_u32,
15070 lat: 0_i32,
15071 lon: 0_i32,
15072 alt: 0_i32,
15073 relative_alt: 0_i32,
15074 vx: 0_i16,
15075 vy: 0_i16,
15076 vz: 0_i16,
15077 hdg: 0_u16,
15078 };
15079 #[cfg(feature = "arbitrary")]
15080 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15081 use arbitrary::{Arbitrary, Unstructured};
15082 let mut buf = [0u8; 1024];
15083 rng.fill_bytes(&mut buf);
15084 let mut unstructured = Unstructured::new(&buf);
15085 Self::arbitrary(&mut unstructured).unwrap_or_default()
15086 }
15087}
15088impl Default for GLOBAL_POSITION_INT_DATA {
15089 fn default() -> Self {
15090 Self::DEFAULT.clone()
15091 }
15092}
15093impl MessageData for GLOBAL_POSITION_INT_DATA {
15094 type Message = MavMessage;
15095 const ID: u32 = 33u32;
15096 const NAME: &'static str = "GLOBAL_POSITION_INT";
15097 const EXTRA_CRC: u8 = 104u8;
15098 const ENCODED_LEN: usize = 28usize;
15099 fn deser(
15100 _version: MavlinkVersion,
15101 __input: &[u8],
15102 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15103 let avail_len = __input.len();
15104 let mut payload_buf = [0; Self::ENCODED_LEN];
15105 let mut buf = if avail_len < Self::ENCODED_LEN {
15106 payload_buf[0..avail_len].copy_from_slice(__input);
15107 Bytes::new(&payload_buf)
15108 } else {
15109 Bytes::new(__input)
15110 };
15111 let mut __struct = Self::default();
15112 __struct.time_boot_ms = buf.get_u32_le()?;
15113 __struct.lat = buf.get_i32_le()?;
15114 __struct.lon = buf.get_i32_le()?;
15115 __struct.alt = buf.get_i32_le()?;
15116 __struct.relative_alt = buf.get_i32_le()?;
15117 __struct.vx = buf.get_i16_le()?;
15118 __struct.vy = buf.get_i16_le()?;
15119 __struct.vz = buf.get_i16_le()?;
15120 __struct.hdg = buf.get_u16_le()?;
15121 Ok(__struct)
15122 }
15123 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15124 let mut __tmp = BytesMut::new(bytes);
15125 #[allow(clippy::absurd_extreme_comparisons)]
15126 #[allow(unused_comparisons)]
15127 if __tmp.remaining() < Self::ENCODED_LEN {
15128 panic!(
15129 "buffer is too small (need {} bytes, but got {})",
15130 Self::ENCODED_LEN,
15131 __tmp.remaining(),
15132 )
15133 }
15134 __tmp.put_u32_le(self.time_boot_ms);
15135 __tmp.put_i32_le(self.lat);
15136 __tmp.put_i32_le(self.lon);
15137 __tmp.put_i32_le(self.alt);
15138 __tmp.put_i32_le(self.relative_alt);
15139 __tmp.put_i16_le(self.vx);
15140 __tmp.put_i16_le(self.vy);
15141 __tmp.put_i16_le(self.vz);
15142 __tmp.put_u16_le(self.hdg);
15143 if matches!(version, MavlinkVersion::V2) {
15144 let len = __tmp.len();
15145 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15146 } else {
15147 __tmp.len()
15148 }
15149 }
15150}
15151#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
15152#[doc = ""]
15153#[doc = "ID: 63"]
15154#[derive(Debug, Clone, PartialEq)]
15155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15157#[cfg_attr(feature = "ts", derive(TS))]
15158#[cfg_attr(feature = "ts", ts(export))]
15159pub struct GLOBAL_POSITION_INT_COV_DATA {
15160 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15161 pub time_usec: u64,
15162 #[doc = "Latitude"]
15163 pub lat: i32,
15164 #[doc = "Longitude"]
15165 pub lon: i32,
15166 #[doc = "Altitude in meters above MSL"]
15167 pub alt: i32,
15168 #[doc = "Altitude above ground"]
15169 pub relative_alt: i32,
15170 #[doc = "Ground X Speed (Latitude)"]
15171 pub vx: f32,
15172 #[doc = "Ground Y Speed (Longitude)"]
15173 pub vy: f32,
15174 #[doc = "Ground Z Speed (Altitude)"]
15175 pub vz: f32,
15176 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
15177 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15178 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15179 pub covariance: [f32; 36],
15180 #[doc = "Class id of the estimator this estimate originated from."]
15181 pub estimator_type: MavEstimatorType,
15182}
15183impl GLOBAL_POSITION_INT_COV_DATA {
15184 pub const ENCODED_LEN: usize = 181usize;
15185 pub const DEFAULT: Self = Self {
15186 time_usec: 0_u64,
15187 lat: 0_i32,
15188 lon: 0_i32,
15189 alt: 0_i32,
15190 relative_alt: 0_i32,
15191 vx: 0.0_f32,
15192 vy: 0.0_f32,
15193 vz: 0.0_f32,
15194 covariance: [0.0_f32; 36usize],
15195 estimator_type: MavEstimatorType::DEFAULT,
15196 };
15197 #[cfg(feature = "arbitrary")]
15198 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15199 use arbitrary::{Arbitrary, Unstructured};
15200 let mut buf = [0u8; 1024];
15201 rng.fill_bytes(&mut buf);
15202 let mut unstructured = Unstructured::new(&buf);
15203 Self::arbitrary(&mut unstructured).unwrap_or_default()
15204 }
15205}
15206impl Default for GLOBAL_POSITION_INT_COV_DATA {
15207 fn default() -> Self {
15208 Self::DEFAULT.clone()
15209 }
15210}
15211impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
15212 type Message = MavMessage;
15213 const ID: u32 = 63u32;
15214 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
15215 const EXTRA_CRC: u8 = 119u8;
15216 const ENCODED_LEN: usize = 181usize;
15217 fn deser(
15218 _version: MavlinkVersion,
15219 __input: &[u8],
15220 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15221 let avail_len = __input.len();
15222 let mut payload_buf = [0; Self::ENCODED_LEN];
15223 let mut buf = if avail_len < Self::ENCODED_LEN {
15224 payload_buf[0..avail_len].copy_from_slice(__input);
15225 Bytes::new(&payload_buf)
15226 } else {
15227 Bytes::new(__input)
15228 };
15229 let mut __struct = Self::default();
15230 __struct.time_usec = buf.get_u64_le()?;
15231 __struct.lat = buf.get_i32_le()?;
15232 __struct.lon = buf.get_i32_le()?;
15233 __struct.alt = buf.get_i32_le()?;
15234 __struct.relative_alt = buf.get_i32_le()?;
15235 __struct.vx = buf.get_f32_le()?;
15236 __struct.vy = buf.get_f32_le()?;
15237 __struct.vz = buf.get_f32_le()?;
15238 for v in &mut __struct.covariance {
15239 let val = buf.get_f32_le()?;
15240 *v = val;
15241 }
15242 let tmp = buf.get_u8()?;
15243 __struct.estimator_type =
15244 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15245 enum_type: "MavEstimatorType",
15246 value: tmp as u64,
15247 })?;
15248 Ok(__struct)
15249 }
15250 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15251 let mut __tmp = BytesMut::new(bytes);
15252 #[allow(clippy::absurd_extreme_comparisons)]
15253 #[allow(unused_comparisons)]
15254 if __tmp.remaining() < Self::ENCODED_LEN {
15255 panic!(
15256 "buffer is too small (need {} bytes, but got {})",
15257 Self::ENCODED_LEN,
15258 __tmp.remaining(),
15259 )
15260 }
15261 __tmp.put_u64_le(self.time_usec);
15262 __tmp.put_i32_le(self.lat);
15263 __tmp.put_i32_le(self.lon);
15264 __tmp.put_i32_le(self.alt);
15265 __tmp.put_i32_le(self.relative_alt);
15266 __tmp.put_f32_le(self.vx);
15267 __tmp.put_f32_le(self.vy);
15268 __tmp.put_f32_le(self.vz);
15269 for val in &self.covariance {
15270 __tmp.put_f32_le(*val);
15271 }
15272 __tmp.put_u8(self.estimator_type as u8);
15273 if matches!(version, MavlinkVersion::V2) {
15274 let len = __tmp.len();
15275 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15276 } else {
15277 __tmp.len()
15278 }
15279 }
15280}
15281#[doc = "Global position/attitude estimate from a vision source."]
15282#[doc = ""]
15283#[doc = "ID: 101"]
15284#[derive(Debug, Clone, PartialEq)]
15285#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15286#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15287#[cfg_attr(feature = "ts", derive(TS))]
15288#[cfg_attr(feature = "ts", ts(export))]
15289pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
15290 #[doc = "Timestamp (UNIX time or since system boot)"]
15291 pub usec: u64,
15292 #[doc = "Global X position"]
15293 pub x: f32,
15294 #[doc = "Global Y position"]
15295 pub y: f32,
15296 #[doc = "Global Z position"]
15297 pub z: f32,
15298 #[doc = "Roll angle"]
15299 pub roll: f32,
15300 #[doc = "Pitch angle"]
15301 pub pitch: f32,
15302 #[doc = "Yaw angle"]
15303 pub yaw: f32,
15304 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
15305 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15306 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15307 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15308 pub covariance: [f32; 21],
15309 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
15310 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15311 pub reset_counter: u8,
15312}
15313impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
15314 pub const ENCODED_LEN: usize = 117usize;
15315 pub const DEFAULT: Self = Self {
15316 usec: 0_u64,
15317 x: 0.0_f32,
15318 y: 0.0_f32,
15319 z: 0.0_f32,
15320 roll: 0.0_f32,
15321 pitch: 0.0_f32,
15322 yaw: 0.0_f32,
15323 covariance: [0.0_f32; 21usize],
15324 reset_counter: 0_u8,
15325 };
15326 #[cfg(feature = "arbitrary")]
15327 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15328 use arbitrary::{Arbitrary, Unstructured};
15329 let mut buf = [0u8; 1024];
15330 rng.fill_bytes(&mut buf);
15331 let mut unstructured = Unstructured::new(&buf);
15332 Self::arbitrary(&mut unstructured).unwrap_or_default()
15333 }
15334}
15335impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
15336 fn default() -> Self {
15337 Self::DEFAULT.clone()
15338 }
15339}
15340impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
15341 type Message = MavMessage;
15342 const ID: u32 = 101u32;
15343 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
15344 const EXTRA_CRC: u8 = 102u8;
15345 const ENCODED_LEN: usize = 117usize;
15346 fn deser(
15347 _version: MavlinkVersion,
15348 __input: &[u8],
15349 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15350 let avail_len = __input.len();
15351 let mut payload_buf = [0; Self::ENCODED_LEN];
15352 let mut buf = if avail_len < Self::ENCODED_LEN {
15353 payload_buf[0..avail_len].copy_from_slice(__input);
15354 Bytes::new(&payload_buf)
15355 } else {
15356 Bytes::new(__input)
15357 };
15358 let mut __struct = Self::default();
15359 __struct.usec = buf.get_u64_le()?;
15360 __struct.x = buf.get_f32_le()?;
15361 __struct.y = buf.get_f32_le()?;
15362 __struct.z = buf.get_f32_le()?;
15363 __struct.roll = buf.get_f32_le()?;
15364 __struct.pitch = buf.get_f32_le()?;
15365 __struct.yaw = buf.get_f32_le()?;
15366 for v in &mut __struct.covariance {
15367 let val = buf.get_f32_le()?;
15368 *v = val;
15369 }
15370 __struct.reset_counter = buf.get_u8()?;
15371 Ok(__struct)
15372 }
15373 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15374 let mut __tmp = BytesMut::new(bytes);
15375 #[allow(clippy::absurd_extreme_comparisons)]
15376 #[allow(unused_comparisons)]
15377 if __tmp.remaining() < Self::ENCODED_LEN {
15378 panic!(
15379 "buffer is too small (need {} bytes, but got {})",
15380 Self::ENCODED_LEN,
15381 __tmp.remaining(),
15382 )
15383 }
15384 __tmp.put_u64_le(self.usec);
15385 __tmp.put_f32_le(self.x);
15386 __tmp.put_f32_le(self.y);
15387 __tmp.put_f32_le(self.z);
15388 __tmp.put_f32_le(self.roll);
15389 __tmp.put_f32_le(self.pitch);
15390 __tmp.put_f32_le(self.yaw);
15391 if matches!(version, MavlinkVersion::V2) {
15392 for val in &self.covariance {
15393 __tmp.put_f32_le(*val);
15394 }
15395 __tmp.put_u8(self.reset_counter);
15396 let len = __tmp.len();
15397 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15398 } else {
15399 __tmp.len()
15400 }
15401 }
15402}
15403#[doc = "Second GPS data."]
15404#[doc = ""]
15405#[doc = "ID: 124"]
15406#[derive(Debug, Clone, PartialEq)]
15407#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15408#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15409#[cfg_attr(feature = "ts", derive(TS))]
15410#[cfg_attr(feature = "ts", ts(export))]
15411pub struct GPS2_RAW_DATA {
15412 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15413 pub time_usec: u64,
15414 #[doc = "Latitude (WGS84)"]
15415 pub lat: i32,
15416 #[doc = "Longitude (WGS84)"]
15417 pub lon: i32,
15418 #[doc = "Altitude (MSL). Positive for up."]
15419 pub alt: i32,
15420 #[doc = "Age of DGPS info"]
15421 pub dgps_age: u32,
15422 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15423 pub eph: u16,
15424 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15425 pub epv: u16,
15426 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15427 pub vel: u16,
15428 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15429 pub cog: u16,
15430 #[doc = "GPS fix type."]
15431 pub fix_type: GpsFixType,
15432 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15433 pub satellites_visible: u8,
15434 #[doc = "Number of DGPS satellites"]
15435 pub dgps_numch: u8,
15436 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
15437 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15438 pub yaw: u16,
15439 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
15440 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15441 pub alt_ellipsoid: i32,
15442 #[doc = "Position uncertainty."]
15443 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15444 pub h_acc: u32,
15445 #[doc = "Altitude uncertainty."]
15446 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15447 pub v_acc: u32,
15448 #[doc = "Speed uncertainty."]
15449 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15450 pub vel_acc: u32,
15451 #[doc = "Heading / track uncertainty"]
15452 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15453 pub hdg_acc: u32,
15454}
15455impl GPS2_RAW_DATA {
15456 pub const ENCODED_LEN: usize = 57usize;
15457 pub const DEFAULT: Self = Self {
15458 time_usec: 0_u64,
15459 lat: 0_i32,
15460 lon: 0_i32,
15461 alt: 0_i32,
15462 dgps_age: 0_u32,
15463 eph: 0_u16,
15464 epv: 0_u16,
15465 vel: 0_u16,
15466 cog: 0_u16,
15467 fix_type: GpsFixType::DEFAULT,
15468 satellites_visible: 0_u8,
15469 dgps_numch: 0_u8,
15470 yaw: 0_u16,
15471 alt_ellipsoid: 0_i32,
15472 h_acc: 0_u32,
15473 v_acc: 0_u32,
15474 vel_acc: 0_u32,
15475 hdg_acc: 0_u32,
15476 };
15477 #[cfg(feature = "arbitrary")]
15478 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15479 use arbitrary::{Arbitrary, Unstructured};
15480 let mut buf = [0u8; 1024];
15481 rng.fill_bytes(&mut buf);
15482 let mut unstructured = Unstructured::new(&buf);
15483 Self::arbitrary(&mut unstructured).unwrap_or_default()
15484 }
15485}
15486impl Default for GPS2_RAW_DATA {
15487 fn default() -> Self {
15488 Self::DEFAULT.clone()
15489 }
15490}
15491impl MessageData for GPS2_RAW_DATA {
15492 type Message = MavMessage;
15493 const ID: u32 = 124u32;
15494 const NAME: &'static str = "GPS2_RAW";
15495 const EXTRA_CRC: u8 = 87u8;
15496 const ENCODED_LEN: usize = 57usize;
15497 fn deser(
15498 _version: MavlinkVersion,
15499 __input: &[u8],
15500 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15501 let avail_len = __input.len();
15502 let mut payload_buf = [0; Self::ENCODED_LEN];
15503 let mut buf = if avail_len < Self::ENCODED_LEN {
15504 payload_buf[0..avail_len].copy_from_slice(__input);
15505 Bytes::new(&payload_buf)
15506 } else {
15507 Bytes::new(__input)
15508 };
15509 let mut __struct = Self::default();
15510 __struct.time_usec = buf.get_u64_le()?;
15511 __struct.lat = buf.get_i32_le()?;
15512 __struct.lon = buf.get_i32_le()?;
15513 __struct.alt = buf.get_i32_le()?;
15514 __struct.dgps_age = buf.get_u32_le()?;
15515 __struct.eph = buf.get_u16_le()?;
15516 __struct.epv = buf.get_u16_le()?;
15517 __struct.vel = buf.get_u16_le()?;
15518 __struct.cog = buf.get_u16_le()?;
15519 let tmp = buf.get_u8()?;
15520 __struct.fix_type =
15521 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15522 enum_type: "GpsFixType",
15523 value: tmp as u64,
15524 })?;
15525 __struct.satellites_visible = buf.get_u8()?;
15526 __struct.dgps_numch = buf.get_u8()?;
15527 __struct.yaw = buf.get_u16_le()?;
15528 __struct.alt_ellipsoid = buf.get_i32_le()?;
15529 __struct.h_acc = buf.get_u32_le()?;
15530 __struct.v_acc = buf.get_u32_le()?;
15531 __struct.vel_acc = buf.get_u32_le()?;
15532 __struct.hdg_acc = buf.get_u32_le()?;
15533 Ok(__struct)
15534 }
15535 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15536 let mut __tmp = BytesMut::new(bytes);
15537 #[allow(clippy::absurd_extreme_comparisons)]
15538 #[allow(unused_comparisons)]
15539 if __tmp.remaining() < Self::ENCODED_LEN {
15540 panic!(
15541 "buffer is too small (need {} bytes, but got {})",
15542 Self::ENCODED_LEN,
15543 __tmp.remaining(),
15544 )
15545 }
15546 __tmp.put_u64_le(self.time_usec);
15547 __tmp.put_i32_le(self.lat);
15548 __tmp.put_i32_le(self.lon);
15549 __tmp.put_i32_le(self.alt);
15550 __tmp.put_u32_le(self.dgps_age);
15551 __tmp.put_u16_le(self.eph);
15552 __tmp.put_u16_le(self.epv);
15553 __tmp.put_u16_le(self.vel);
15554 __tmp.put_u16_le(self.cog);
15555 __tmp.put_u8(self.fix_type as u8);
15556 __tmp.put_u8(self.satellites_visible);
15557 __tmp.put_u8(self.dgps_numch);
15558 if matches!(version, MavlinkVersion::V2) {
15559 __tmp.put_u16_le(self.yaw);
15560 __tmp.put_i32_le(self.alt_ellipsoid);
15561 __tmp.put_u32_le(self.h_acc);
15562 __tmp.put_u32_le(self.v_acc);
15563 __tmp.put_u32_le(self.vel_acc);
15564 __tmp.put_u32_le(self.hdg_acc);
15565 let len = __tmp.len();
15566 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15567 } else {
15568 __tmp.len()
15569 }
15570 }
15571}
15572#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
15573#[doc = ""]
15574#[doc = "ID: 128"]
15575#[derive(Debug, Clone, PartialEq)]
15576#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15577#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15578#[cfg_attr(feature = "ts", derive(TS))]
15579#[cfg_attr(feature = "ts", ts(export))]
15580pub struct GPS2_RTK_DATA {
15581 #[doc = "Time since boot of last baseline message received."]
15582 pub time_last_baseline_ms: u32,
15583 #[doc = "GPS Time of Week of last baseline"]
15584 pub tow: u32,
15585 #[doc = "Current baseline in ECEF x or NED north component."]
15586 pub baseline_a_mm: i32,
15587 #[doc = "Current baseline in ECEF y or NED east component."]
15588 pub baseline_b_mm: i32,
15589 #[doc = "Current baseline in ECEF z or NED down component."]
15590 pub baseline_c_mm: i32,
15591 #[doc = "Current estimate of baseline accuracy."]
15592 pub accuracy: u32,
15593 #[doc = "Current number of integer ambiguity hypotheses."]
15594 pub iar_num_hypotheses: i32,
15595 #[doc = "GPS Week Number of last baseline"]
15596 pub wn: u16,
15597 #[doc = "Identification of connected RTK receiver."]
15598 pub rtk_receiver_id: u8,
15599 #[doc = "GPS-specific health report for RTK data."]
15600 pub rtk_health: u8,
15601 #[doc = "Rate of baseline messages being received by GPS"]
15602 pub rtk_rate: u8,
15603 #[doc = "Current number of sats used for RTK calculation."]
15604 pub nsats: u8,
15605 #[doc = "Coordinate system of baseline"]
15606 pub baseline_coords_type: RtkBaselineCoordinateSystem,
15607}
15608impl GPS2_RTK_DATA {
15609 pub const ENCODED_LEN: usize = 35usize;
15610 pub const DEFAULT: Self = Self {
15611 time_last_baseline_ms: 0_u32,
15612 tow: 0_u32,
15613 baseline_a_mm: 0_i32,
15614 baseline_b_mm: 0_i32,
15615 baseline_c_mm: 0_i32,
15616 accuracy: 0_u32,
15617 iar_num_hypotheses: 0_i32,
15618 wn: 0_u16,
15619 rtk_receiver_id: 0_u8,
15620 rtk_health: 0_u8,
15621 rtk_rate: 0_u8,
15622 nsats: 0_u8,
15623 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
15624 };
15625 #[cfg(feature = "arbitrary")]
15626 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15627 use arbitrary::{Arbitrary, Unstructured};
15628 let mut buf = [0u8; 1024];
15629 rng.fill_bytes(&mut buf);
15630 let mut unstructured = Unstructured::new(&buf);
15631 Self::arbitrary(&mut unstructured).unwrap_or_default()
15632 }
15633}
15634impl Default for GPS2_RTK_DATA {
15635 fn default() -> Self {
15636 Self::DEFAULT.clone()
15637 }
15638}
15639impl MessageData for GPS2_RTK_DATA {
15640 type Message = MavMessage;
15641 const ID: u32 = 128u32;
15642 const NAME: &'static str = "GPS2_RTK";
15643 const EXTRA_CRC: u8 = 226u8;
15644 const ENCODED_LEN: usize = 35usize;
15645 fn deser(
15646 _version: MavlinkVersion,
15647 __input: &[u8],
15648 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15649 let avail_len = __input.len();
15650 let mut payload_buf = [0; Self::ENCODED_LEN];
15651 let mut buf = if avail_len < Self::ENCODED_LEN {
15652 payload_buf[0..avail_len].copy_from_slice(__input);
15653 Bytes::new(&payload_buf)
15654 } else {
15655 Bytes::new(__input)
15656 };
15657 let mut __struct = Self::default();
15658 __struct.time_last_baseline_ms = buf.get_u32_le()?;
15659 __struct.tow = buf.get_u32_le()?;
15660 __struct.baseline_a_mm = buf.get_i32_le()?;
15661 __struct.baseline_b_mm = buf.get_i32_le()?;
15662 __struct.baseline_c_mm = buf.get_i32_le()?;
15663 __struct.accuracy = buf.get_u32_le()?;
15664 __struct.iar_num_hypotheses = buf.get_i32_le()?;
15665 __struct.wn = buf.get_u16_le()?;
15666 __struct.rtk_receiver_id = buf.get_u8()?;
15667 __struct.rtk_health = buf.get_u8()?;
15668 __struct.rtk_rate = buf.get_u8()?;
15669 __struct.nsats = buf.get_u8()?;
15670 let tmp = buf.get_u8()?;
15671 __struct.baseline_coords_type =
15672 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15673 enum_type: "RtkBaselineCoordinateSystem",
15674 value: tmp as u64,
15675 })?;
15676 Ok(__struct)
15677 }
15678 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15679 let mut __tmp = BytesMut::new(bytes);
15680 #[allow(clippy::absurd_extreme_comparisons)]
15681 #[allow(unused_comparisons)]
15682 if __tmp.remaining() < Self::ENCODED_LEN {
15683 panic!(
15684 "buffer is too small (need {} bytes, but got {})",
15685 Self::ENCODED_LEN,
15686 __tmp.remaining(),
15687 )
15688 }
15689 __tmp.put_u32_le(self.time_last_baseline_ms);
15690 __tmp.put_u32_le(self.tow);
15691 __tmp.put_i32_le(self.baseline_a_mm);
15692 __tmp.put_i32_le(self.baseline_b_mm);
15693 __tmp.put_i32_le(self.baseline_c_mm);
15694 __tmp.put_u32_le(self.accuracy);
15695 __tmp.put_i32_le(self.iar_num_hypotheses);
15696 __tmp.put_u16_le(self.wn);
15697 __tmp.put_u8(self.rtk_receiver_id);
15698 __tmp.put_u8(self.rtk_health);
15699 __tmp.put_u8(self.rtk_rate);
15700 __tmp.put_u8(self.nsats);
15701 __tmp.put_u8(self.baseline_coords_type as u8);
15702 if matches!(version, MavlinkVersion::V2) {
15703 let len = __tmp.len();
15704 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15705 } else {
15706 __tmp.len()
15707 }
15708 }
15709}
15710#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
15711#[doc = ""]
15712#[doc = "ID: 49"]
15713#[derive(Debug, Clone, PartialEq)]
15714#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15715#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15716#[cfg_attr(feature = "ts", derive(TS))]
15717#[cfg_attr(feature = "ts", ts(export))]
15718pub struct GPS_GLOBAL_ORIGIN_DATA {
15719 #[doc = "Latitude (WGS84)"]
15720 pub latitude: i32,
15721 #[doc = "Longitude (WGS84)"]
15722 pub longitude: i32,
15723 #[doc = "Altitude (MSL). Positive for up."]
15724 pub altitude: i32,
15725 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15726 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15727 pub time_usec: u64,
15728}
15729impl GPS_GLOBAL_ORIGIN_DATA {
15730 pub const ENCODED_LEN: usize = 20usize;
15731 pub const DEFAULT: Self = Self {
15732 latitude: 0_i32,
15733 longitude: 0_i32,
15734 altitude: 0_i32,
15735 time_usec: 0_u64,
15736 };
15737 #[cfg(feature = "arbitrary")]
15738 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15739 use arbitrary::{Arbitrary, Unstructured};
15740 let mut buf = [0u8; 1024];
15741 rng.fill_bytes(&mut buf);
15742 let mut unstructured = Unstructured::new(&buf);
15743 Self::arbitrary(&mut unstructured).unwrap_or_default()
15744 }
15745}
15746impl Default for GPS_GLOBAL_ORIGIN_DATA {
15747 fn default() -> Self {
15748 Self::DEFAULT.clone()
15749 }
15750}
15751impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
15752 type Message = MavMessage;
15753 const ID: u32 = 49u32;
15754 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
15755 const EXTRA_CRC: u8 = 39u8;
15756 const ENCODED_LEN: usize = 20usize;
15757 fn deser(
15758 _version: MavlinkVersion,
15759 __input: &[u8],
15760 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15761 let avail_len = __input.len();
15762 let mut payload_buf = [0; Self::ENCODED_LEN];
15763 let mut buf = if avail_len < Self::ENCODED_LEN {
15764 payload_buf[0..avail_len].copy_from_slice(__input);
15765 Bytes::new(&payload_buf)
15766 } else {
15767 Bytes::new(__input)
15768 };
15769 let mut __struct = Self::default();
15770 __struct.latitude = buf.get_i32_le()?;
15771 __struct.longitude = buf.get_i32_le()?;
15772 __struct.altitude = buf.get_i32_le()?;
15773 __struct.time_usec = buf.get_u64_le()?;
15774 Ok(__struct)
15775 }
15776 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15777 let mut __tmp = BytesMut::new(bytes);
15778 #[allow(clippy::absurd_extreme_comparisons)]
15779 #[allow(unused_comparisons)]
15780 if __tmp.remaining() < Self::ENCODED_LEN {
15781 panic!(
15782 "buffer is too small (need {} bytes, but got {})",
15783 Self::ENCODED_LEN,
15784 __tmp.remaining(),
15785 )
15786 }
15787 __tmp.put_i32_le(self.latitude);
15788 __tmp.put_i32_le(self.longitude);
15789 __tmp.put_i32_le(self.altitude);
15790 if matches!(version, MavlinkVersion::V2) {
15791 __tmp.put_u64_le(self.time_usec);
15792 let len = __tmp.len();
15793 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15794 } else {
15795 __tmp.len()
15796 }
15797 }
15798}
15799#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
15800#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
15801#[doc = ""]
15802#[doc = "ID: 123"]
15803#[derive(Debug, Clone, PartialEq)]
15804#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15805#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15806#[cfg_attr(feature = "ts", derive(TS))]
15807#[cfg_attr(feature = "ts", ts(export))]
15808pub struct GPS_INJECT_DATA_DATA {
15809 #[doc = "System ID"]
15810 pub target_system: u8,
15811 #[doc = "Component ID"]
15812 pub target_component: u8,
15813 #[doc = "Data length"]
15814 pub len: u8,
15815 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
15816 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15817 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15818 pub data: [u8; 110],
15819}
15820impl GPS_INJECT_DATA_DATA {
15821 pub const ENCODED_LEN: usize = 113usize;
15822 pub const DEFAULT: Self = Self {
15823 target_system: 0_u8,
15824 target_component: 0_u8,
15825 len: 0_u8,
15826 data: [0_u8; 110usize],
15827 };
15828 #[cfg(feature = "arbitrary")]
15829 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15830 use arbitrary::{Arbitrary, Unstructured};
15831 let mut buf = [0u8; 1024];
15832 rng.fill_bytes(&mut buf);
15833 let mut unstructured = Unstructured::new(&buf);
15834 Self::arbitrary(&mut unstructured).unwrap_or_default()
15835 }
15836}
15837impl Default for GPS_INJECT_DATA_DATA {
15838 fn default() -> Self {
15839 Self::DEFAULT.clone()
15840 }
15841}
15842impl MessageData for GPS_INJECT_DATA_DATA {
15843 type Message = MavMessage;
15844 const ID: u32 = 123u32;
15845 const NAME: &'static str = "GPS_INJECT_DATA";
15846 const EXTRA_CRC: u8 = 250u8;
15847 const ENCODED_LEN: usize = 113usize;
15848 fn deser(
15849 _version: MavlinkVersion,
15850 __input: &[u8],
15851 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15852 let avail_len = __input.len();
15853 let mut payload_buf = [0; Self::ENCODED_LEN];
15854 let mut buf = if avail_len < Self::ENCODED_LEN {
15855 payload_buf[0..avail_len].copy_from_slice(__input);
15856 Bytes::new(&payload_buf)
15857 } else {
15858 Bytes::new(__input)
15859 };
15860 let mut __struct = Self::default();
15861 __struct.target_system = buf.get_u8()?;
15862 __struct.target_component = buf.get_u8()?;
15863 __struct.len = buf.get_u8()?;
15864 for v in &mut __struct.data {
15865 let val = buf.get_u8()?;
15866 *v = val;
15867 }
15868 Ok(__struct)
15869 }
15870 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15871 let mut __tmp = BytesMut::new(bytes);
15872 #[allow(clippy::absurd_extreme_comparisons)]
15873 #[allow(unused_comparisons)]
15874 if __tmp.remaining() < Self::ENCODED_LEN {
15875 panic!(
15876 "buffer is too small (need {} bytes, but got {})",
15877 Self::ENCODED_LEN,
15878 __tmp.remaining(),
15879 )
15880 }
15881 __tmp.put_u8(self.target_system);
15882 __tmp.put_u8(self.target_component);
15883 __tmp.put_u8(self.len);
15884 for val in &self.data {
15885 __tmp.put_u8(*val);
15886 }
15887 if matches!(version, MavlinkVersion::V2) {
15888 let len = __tmp.len();
15889 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15890 } else {
15891 __tmp.len()
15892 }
15893 }
15894}
15895#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
15896#[doc = ""]
15897#[doc = "ID: 232"]
15898#[derive(Debug, Clone, PartialEq)]
15899#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15900#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15901#[cfg_attr(feature = "ts", derive(TS))]
15902#[cfg_attr(feature = "ts", ts(export))]
15903pub struct GPS_INPUT_DATA {
15904 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15905 pub time_usec: u64,
15906 #[doc = "GPS time (from start of GPS week)"]
15907 pub time_week_ms: u32,
15908 #[doc = "Latitude (WGS84)"]
15909 pub lat: i32,
15910 #[doc = "Longitude (WGS84)"]
15911 pub lon: i32,
15912 #[doc = "Altitude (MSL). Positive for up."]
15913 pub alt: f32,
15914 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
15915 pub hdop: f32,
15916 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
15917 pub vdop: f32,
15918 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15919 pub vn: f32,
15920 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15921 pub ve: f32,
15922 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15923 pub vd: f32,
15924 #[doc = "GPS speed accuracy"]
15925 pub speed_accuracy: f32,
15926 #[doc = "GPS horizontal accuracy"]
15927 pub horiz_accuracy: f32,
15928 #[doc = "GPS vertical accuracy"]
15929 pub vert_accuracy: f32,
15930 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
15931 pub ignore_flags: GpsInputIgnoreFlags,
15932 #[doc = "GPS week number"]
15933 pub time_week: u16,
15934 #[doc = "ID of the GPS for multiple GPS inputs"]
15935 pub gps_id: u8,
15936 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
15937 pub fix_type: u8,
15938 #[doc = "Number of satellites visible."]
15939 pub satellites_visible: u8,
15940 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15941 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15942 pub yaw: u16,
15943}
15944impl GPS_INPUT_DATA {
15945 pub const ENCODED_LEN: usize = 65usize;
15946 pub const DEFAULT: Self = Self {
15947 time_usec: 0_u64,
15948 time_week_ms: 0_u32,
15949 lat: 0_i32,
15950 lon: 0_i32,
15951 alt: 0.0_f32,
15952 hdop: 0.0_f32,
15953 vdop: 0.0_f32,
15954 vn: 0.0_f32,
15955 ve: 0.0_f32,
15956 vd: 0.0_f32,
15957 speed_accuracy: 0.0_f32,
15958 horiz_accuracy: 0.0_f32,
15959 vert_accuracy: 0.0_f32,
15960 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
15961 time_week: 0_u16,
15962 gps_id: 0_u8,
15963 fix_type: 0_u8,
15964 satellites_visible: 0_u8,
15965 yaw: 0_u16,
15966 };
15967 #[cfg(feature = "arbitrary")]
15968 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15969 use arbitrary::{Arbitrary, Unstructured};
15970 let mut buf = [0u8; 1024];
15971 rng.fill_bytes(&mut buf);
15972 let mut unstructured = Unstructured::new(&buf);
15973 Self::arbitrary(&mut unstructured).unwrap_or_default()
15974 }
15975}
15976impl Default for GPS_INPUT_DATA {
15977 fn default() -> Self {
15978 Self::DEFAULT.clone()
15979 }
15980}
15981impl MessageData for GPS_INPUT_DATA {
15982 type Message = MavMessage;
15983 const ID: u32 = 232u32;
15984 const NAME: &'static str = "GPS_INPUT";
15985 const EXTRA_CRC: u8 = 151u8;
15986 const ENCODED_LEN: usize = 65usize;
15987 fn deser(
15988 _version: MavlinkVersion,
15989 __input: &[u8],
15990 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15991 let avail_len = __input.len();
15992 let mut payload_buf = [0; Self::ENCODED_LEN];
15993 let mut buf = if avail_len < Self::ENCODED_LEN {
15994 payload_buf[0..avail_len].copy_from_slice(__input);
15995 Bytes::new(&payload_buf)
15996 } else {
15997 Bytes::new(__input)
15998 };
15999 let mut __struct = Self::default();
16000 __struct.time_usec = buf.get_u64_le()?;
16001 __struct.time_week_ms = buf.get_u32_le()?;
16002 __struct.lat = buf.get_i32_le()?;
16003 __struct.lon = buf.get_i32_le()?;
16004 __struct.alt = buf.get_f32_le()?;
16005 __struct.hdop = buf.get_f32_le()?;
16006 __struct.vdop = buf.get_f32_le()?;
16007 __struct.vn = buf.get_f32_le()?;
16008 __struct.ve = buf.get_f32_le()?;
16009 __struct.vd = buf.get_f32_le()?;
16010 __struct.speed_accuracy = buf.get_f32_le()?;
16011 __struct.horiz_accuracy = buf.get_f32_le()?;
16012 __struct.vert_accuracy = buf.get_f32_le()?;
16013 let tmp = buf.get_u16_le()?;
16014 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
16015 tmp as <GpsInputIgnoreFlags as Flags>::Bits,
16016 )
16017 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16018 flag_type: "GpsInputIgnoreFlags",
16019 value: tmp as u64,
16020 })?;
16021 __struct.time_week = buf.get_u16_le()?;
16022 __struct.gps_id = buf.get_u8()?;
16023 __struct.fix_type = buf.get_u8()?;
16024 __struct.satellites_visible = buf.get_u8()?;
16025 __struct.yaw = buf.get_u16_le()?;
16026 Ok(__struct)
16027 }
16028 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16029 let mut __tmp = BytesMut::new(bytes);
16030 #[allow(clippy::absurd_extreme_comparisons)]
16031 #[allow(unused_comparisons)]
16032 if __tmp.remaining() < Self::ENCODED_LEN {
16033 panic!(
16034 "buffer is too small (need {} bytes, but got {})",
16035 Self::ENCODED_LEN,
16036 __tmp.remaining(),
16037 )
16038 }
16039 __tmp.put_u64_le(self.time_usec);
16040 __tmp.put_u32_le(self.time_week_ms);
16041 __tmp.put_i32_le(self.lat);
16042 __tmp.put_i32_le(self.lon);
16043 __tmp.put_f32_le(self.alt);
16044 __tmp.put_f32_le(self.hdop);
16045 __tmp.put_f32_le(self.vdop);
16046 __tmp.put_f32_le(self.vn);
16047 __tmp.put_f32_le(self.ve);
16048 __tmp.put_f32_le(self.vd);
16049 __tmp.put_f32_le(self.speed_accuracy);
16050 __tmp.put_f32_le(self.horiz_accuracy);
16051 __tmp.put_f32_le(self.vert_accuracy);
16052 __tmp.put_u16_le(self.ignore_flags.bits() as u16);
16053 __tmp.put_u16_le(self.time_week);
16054 __tmp.put_u8(self.gps_id);
16055 __tmp.put_u8(self.fix_type);
16056 __tmp.put_u8(self.satellites_visible);
16057 if matches!(version, MavlinkVersion::V2) {
16058 __tmp.put_u16_le(self.yaw);
16059 let len = __tmp.len();
16060 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16061 } else {
16062 __tmp.len()
16063 }
16064 }
16065}
16066#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
16067#[doc = ""]
16068#[doc = "ID: 24"]
16069#[derive(Debug, Clone, PartialEq)]
16070#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16071#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16072#[cfg_attr(feature = "ts", derive(TS))]
16073#[cfg_attr(feature = "ts", ts(export))]
16074pub struct GPS_RAW_INT_DATA {
16075 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16076 pub time_usec: u64,
16077 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
16078 pub lat: i32,
16079 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
16080 pub lon: i32,
16081 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
16082 pub alt: i32,
16083 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16084 pub eph: u16,
16085 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16086 pub epv: u16,
16087 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
16088 pub vel: u16,
16089 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
16090 pub cog: u16,
16091 #[doc = "GPS fix type."]
16092 pub fix_type: GpsFixType,
16093 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16094 pub satellites_visible: u8,
16095 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
16096 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16097 pub alt_ellipsoid: i32,
16098 #[doc = "Position uncertainty."]
16099 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16100 pub h_acc: u32,
16101 #[doc = "Altitude uncertainty."]
16102 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16103 pub v_acc: u32,
16104 #[doc = "Speed uncertainty."]
16105 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16106 pub vel_acc: u32,
16107 #[doc = "Heading / track uncertainty"]
16108 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16109 pub hdg_acc: u32,
16110 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
16111 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16112 pub yaw: u16,
16113}
16114impl GPS_RAW_INT_DATA {
16115 pub const ENCODED_LEN: usize = 52usize;
16116 pub const DEFAULT: Self = Self {
16117 time_usec: 0_u64,
16118 lat: 0_i32,
16119 lon: 0_i32,
16120 alt: 0_i32,
16121 eph: 0_u16,
16122 epv: 0_u16,
16123 vel: 0_u16,
16124 cog: 0_u16,
16125 fix_type: GpsFixType::DEFAULT,
16126 satellites_visible: 0_u8,
16127 alt_ellipsoid: 0_i32,
16128 h_acc: 0_u32,
16129 v_acc: 0_u32,
16130 vel_acc: 0_u32,
16131 hdg_acc: 0_u32,
16132 yaw: 0_u16,
16133 };
16134 #[cfg(feature = "arbitrary")]
16135 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16136 use arbitrary::{Arbitrary, Unstructured};
16137 let mut buf = [0u8; 1024];
16138 rng.fill_bytes(&mut buf);
16139 let mut unstructured = Unstructured::new(&buf);
16140 Self::arbitrary(&mut unstructured).unwrap_or_default()
16141 }
16142}
16143impl Default for GPS_RAW_INT_DATA {
16144 fn default() -> Self {
16145 Self::DEFAULT.clone()
16146 }
16147}
16148impl MessageData for GPS_RAW_INT_DATA {
16149 type Message = MavMessage;
16150 const ID: u32 = 24u32;
16151 const NAME: &'static str = "GPS_RAW_INT";
16152 const EXTRA_CRC: u8 = 24u8;
16153 const ENCODED_LEN: usize = 52usize;
16154 fn deser(
16155 _version: MavlinkVersion,
16156 __input: &[u8],
16157 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16158 let avail_len = __input.len();
16159 let mut payload_buf = [0; Self::ENCODED_LEN];
16160 let mut buf = if avail_len < Self::ENCODED_LEN {
16161 payload_buf[0..avail_len].copy_from_slice(__input);
16162 Bytes::new(&payload_buf)
16163 } else {
16164 Bytes::new(__input)
16165 };
16166 let mut __struct = Self::default();
16167 __struct.time_usec = buf.get_u64_le()?;
16168 __struct.lat = buf.get_i32_le()?;
16169 __struct.lon = buf.get_i32_le()?;
16170 __struct.alt = buf.get_i32_le()?;
16171 __struct.eph = buf.get_u16_le()?;
16172 __struct.epv = buf.get_u16_le()?;
16173 __struct.vel = buf.get_u16_le()?;
16174 __struct.cog = buf.get_u16_le()?;
16175 let tmp = buf.get_u8()?;
16176 __struct.fix_type =
16177 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16178 enum_type: "GpsFixType",
16179 value: tmp as u64,
16180 })?;
16181 __struct.satellites_visible = buf.get_u8()?;
16182 __struct.alt_ellipsoid = buf.get_i32_le()?;
16183 __struct.h_acc = buf.get_u32_le()?;
16184 __struct.v_acc = buf.get_u32_le()?;
16185 __struct.vel_acc = buf.get_u32_le()?;
16186 __struct.hdg_acc = buf.get_u32_le()?;
16187 __struct.yaw = buf.get_u16_le()?;
16188 Ok(__struct)
16189 }
16190 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16191 let mut __tmp = BytesMut::new(bytes);
16192 #[allow(clippy::absurd_extreme_comparisons)]
16193 #[allow(unused_comparisons)]
16194 if __tmp.remaining() < Self::ENCODED_LEN {
16195 panic!(
16196 "buffer is too small (need {} bytes, but got {})",
16197 Self::ENCODED_LEN,
16198 __tmp.remaining(),
16199 )
16200 }
16201 __tmp.put_u64_le(self.time_usec);
16202 __tmp.put_i32_le(self.lat);
16203 __tmp.put_i32_le(self.lon);
16204 __tmp.put_i32_le(self.alt);
16205 __tmp.put_u16_le(self.eph);
16206 __tmp.put_u16_le(self.epv);
16207 __tmp.put_u16_le(self.vel);
16208 __tmp.put_u16_le(self.cog);
16209 __tmp.put_u8(self.fix_type as u8);
16210 __tmp.put_u8(self.satellites_visible);
16211 if matches!(version, MavlinkVersion::V2) {
16212 __tmp.put_i32_le(self.alt_ellipsoid);
16213 __tmp.put_u32_le(self.h_acc);
16214 __tmp.put_u32_le(self.v_acc);
16215 __tmp.put_u32_le(self.vel_acc);
16216 __tmp.put_u32_le(self.hdg_acc);
16217 __tmp.put_u16_le(self.yaw);
16218 let len = __tmp.len();
16219 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16220 } else {
16221 __tmp.len()
16222 }
16223 }
16224}
16225#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
16226#[doc = ""]
16227#[doc = "ID: 233"]
16228#[derive(Debug, Clone, PartialEq)]
16229#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16230#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16231#[cfg_attr(feature = "ts", derive(TS))]
16232#[cfg_attr(feature = "ts", ts(export))]
16233pub struct GPS_RTCM_DATA_DATA {
16234 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
16235 pub flags: u8,
16236 #[doc = "data length"]
16237 pub len: u8,
16238 #[doc = "RTCM message (may be fragmented)"]
16239 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16240 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16241 pub data: [u8; 180],
16242}
16243impl GPS_RTCM_DATA_DATA {
16244 pub const ENCODED_LEN: usize = 182usize;
16245 pub const DEFAULT: Self = Self {
16246 flags: 0_u8,
16247 len: 0_u8,
16248 data: [0_u8; 180usize],
16249 };
16250 #[cfg(feature = "arbitrary")]
16251 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16252 use arbitrary::{Arbitrary, Unstructured};
16253 let mut buf = [0u8; 1024];
16254 rng.fill_bytes(&mut buf);
16255 let mut unstructured = Unstructured::new(&buf);
16256 Self::arbitrary(&mut unstructured).unwrap_or_default()
16257 }
16258}
16259impl Default for GPS_RTCM_DATA_DATA {
16260 fn default() -> Self {
16261 Self::DEFAULT.clone()
16262 }
16263}
16264impl MessageData for GPS_RTCM_DATA_DATA {
16265 type Message = MavMessage;
16266 const ID: u32 = 233u32;
16267 const NAME: &'static str = "GPS_RTCM_DATA";
16268 const EXTRA_CRC: u8 = 35u8;
16269 const ENCODED_LEN: usize = 182usize;
16270 fn deser(
16271 _version: MavlinkVersion,
16272 __input: &[u8],
16273 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16274 let avail_len = __input.len();
16275 let mut payload_buf = [0; Self::ENCODED_LEN];
16276 let mut buf = if avail_len < Self::ENCODED_LEN {
16277 payload_buf[0..avail_len].copy_from_slice(__input);
16278 Bytes::new(&payload_buf)
16279 } else {
16280 Bytes::new(__input)
16281 };
16282 let mut __struct = Self::default();
16283 __struct.flags = buf.get_u8()?;
16284 __struct.len = buf.get_u8()?;
16285 for v in &mut __struct.data {
16286 let val = buf.get_u8()?;
16287 *v = val;
16288 }
16289 Ok(__struct)
16290 }
16291 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16292 let mut __tmp = BytesMut::new(bytes);
16293 #[allow(clippy::absurd_extreme_comparisons)]
16294 #[allow(unused_comparisons)]
16295 if __tmp.remaining() < Self::ENCODED_LEN {
16296 panic!(
16297 "buffer is too small (need {} bytes, but got {})",
16298 Self::ENCODED_LEN,
16299 __tmp.remaining(),
16300 )
16301 }
16302 __tmp.put_u8(self.flags);
16303 __tmp.put_u8(self.len);
16304 for val in &self.data {
16305 __tmp.put_u8(*val);
16306 }
16307 if matches!(version, MavlinkVersion::V2) {
16308 let len = __tmp.len();
16309 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16310 } else {
16311 __tmp.len()
16312 }
16313 }
16314}
16315#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
16316#[doc = ""]
16317#[doc = "ID: 127"]
16318#[derive(Debug, Clone, PartialEq)]
16319#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16320#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16321#[cfg_attr(feature = "ts", derive(TS))]
16322#[cfg_attr(feature = "ts", ts(export))]
16323pub struct GPS_RTK_DATA {
16324 #[doc = "Time since boot of last baseline message received."]
16325 pub time_last_baseline_ms: u32,
16326 #[doc = "GPS Time of Week of last baseline"]
16327 pub tow: u32,
16328 #[doc = "Current baseline in ECEF x or NED north component."]
16329 pub baseline_a_mm: i32,
16330 #[doc = "Current baseline in ECEF y or NED east component."]
16331 pub baseline_b_mm: i32,
16332 #[doc = "Current baseline in ECEF z or NED down component."]
16333 pub baseline_c_mm: i32,
16334 #[doc = "Current estimate of baseline accuracy."]
16335 pub accuracy: u32,
16336 #[doc = "Current number of integer ambiguity hypotheses."]
16337 pub iar_num_hypotheses: i32,
16338 #[doc = "GPS Week Number of last baseline"]
16339 pub wn: u16,
16340 #[doc = "Identification of connected RTK receiver."]
16341 pub rtk_receiver_id: u8,
16342 #[doc = "GPS-specific health report for RTK data."]
16343 pub rtk_health: u8,
16344 #[doc = "Rate of baseline messages being received by GPS"]
16345 pub rtk_rate: u8,
16346 #[doc = "Current number of sats used for RTK calculation."]
16347 pub nsats: u8,
16348 #[doc = "Coordinate system of baseline"]
16349 pub baseline_coords_type: RtkBaselineCoordinateSystem,
16350}
16351impl GPS_RTK_DATA {
16352 pub const ENCODED_LEN: usize = 35usize;
16353 pub const DEFAULT: Self = Self {
16354 time_last_baseline_ms: 0_u32,
16355 tow: 0_u32,
16356 baseline_a_mm: 0_i32,
16357 baseline_b_mm: 0_i32,
16358 baseline_c_mm: 0_i32,
16359 accuracy: 0_u32,
16360 iar_num_hypotheses: 0_i32,
16361 wn: 0_u16,
16362 rtk_receiver_id: 0_u8,
16363 rtk_health: 0_u8,
16364 rtk_rate: 0_u8,
16365 nsats: 0_u8,
16366 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
16367 };
16368 #[cfg(feature = "arbitrary")]
16369 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16370 use arbitrary::{Arbitrary, Unstructured};
16371 let mut buf = [0u8; 1024];
16372 rng.fill_bytes(&mut buf);
16373 let mut unstructured = Unstructured::new(&buf);
16374 Self::arbitrary(&mut unstructured).unwrap_or_default()
16375 }
16376}
16377impl Default for GPS_RTK_DATA {
16378 fn default() -> Self {
16379 Self::DEFAULT.clone()
16380 }
16381}
16382impl MessageData for GPS_RTK_DATA {
16383 type Message = MavMessage;
16384 const ID: u32 = 127u32;
16385 const NAME: &'static str = "GPS_RTK";
16386 const EXTRA_CRC: u8 = 25u8;
16387 const ENCODED_LEN: usize = 35usize;
16388 fn deser(
16389 _version: MavlinkVersion,
16390 __input: &[u8],
16391 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16392 let avail_len = __input.len();
16393 let mut payload_buf = [0; Self::ENCODED_LEN];
16394 let mut buf = if avail_len < Self::ENCODED_LEN {
16395 payload_buf[0..avail_len].copy_from_slice(__input);
16396 Bytes::new(&payload_buf)
16397 } else {
16398 Bytes::new(__input)
16399 };
16400 let mut __struct = Self::default();
16401 __struct.time_last_baseline_ms = buf.get_u32_le()?;
16402 __struct.tow = buf.get_u32_le()?;
16403 __struct.baseline_a_mm = buf.get_i32_le()?;
16404 __struct.baseline_b_mm = buf.get_i32_le()?;
16405 __struct.baseline_c_mm = buf.get_i32_le()?;
16406 __struct.accuracy = buf.get_u32_le()?;
16407 __struct.iar_num_hypotheses = buf.get_i32_le()?;
16408 __struct.wn = buf.get_u16_le()?;
16409 __struct.rtk_receiver_id = buf.get_u8()?;
16410 __struct.rtk_health = buf.get_u8()?;
16411 __struct.rtk_rate = buf.get_u8()?;
16412 __struct.nsats = buf.get_u8()?;
16413 let tmp = buf.get_u8()?;
16414 __struct.baseline_coords_type =
16415 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16416 enum_type: "RtkBaselineCoordinateSystem",
16417 value: tmp as u64,
16418 })?;
16419 Ok(__struct)
16420 }
16421 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16422 let mut __tmp = BytesMut::new(bytes);
16423 #[allow(clippy::absurd_extreme_comparisons)]
16424 #[allow(unused_comparisons)]
16425 if __tmp.remaining() < Self::ENCODED_LEN {
16426 panic!(
16427 "buffer is too small (need {} bytes, but got {})",
16428 Self::ENCODED_LEN,
16429 __tmp.remaining(),
16430 )
16431 }
16432 __tmp.put_u32_le(self.time_last_baseline_ms);
16433 __tmp.put_u32_le(self.tow);
16434 __tmp.put_i32_le(self.baseline_a_mm);
16435 __tmp.put_i32_le(self.baseline_b_mm);
16436 __tmp.put_i32_le(self.baseline_c_mm);
16437 __tmp.put_u32_le(self.accuracy);
16438 __tmp.put_i32_le(self.iar_num_hypotheses);
16439 __tmp.put_u16_le(self.wn);
16440 __tmp.put_u8(self.rtk_receiver_id);
16441 __tmp.put_u8(self.rtk_health);
16442 __tmp.put_u8(self.rtk_rate);
16443 __tmp.put_u8(self.nsats);
16444 __tmp.put_u8(self.baseline_coords_type as u8);
16445 if matches!(version, MavlinkVersion::V2) {
16446 let len = __tmp.len();
16447 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16448 } else {
16449 __tmp.len()
16450 }
16451 }
16452}
16453#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
16454#[doc = ""]
16455#[doc = "ID: 25"]
16456#[derive(Debug, Clone, PartialEq)]
16457#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16458#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16459#[cfg_attr(feature = "ts", derive(TS))]
16460#[cfg_attr(feature = "ts", ts(export))]
16461pub struct GPS_STATUS_DATA {
16462 #[doc = "Number of satellites visible"]
16463 pub satellites_visible: u8,
16464 #[doc = "Global satellite ID"]
16465 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16466 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16467 pub satellite_prn: [u8; 20],
16468 #[doc = "0: Satellite not used, 1: used for localization"]
16469 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16470 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16471 pub satellite_used: [u8; 20],
16472 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
16473 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16474 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16475 pub satellite_elevation: [u8; 20],
16476 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
16477 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16478 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16479 pub satellite_azimuth: [u8; 20],
16480 #[doc = "Signal to noise ratio of satellite"]
16481 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16482 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16483 pub satellite_snr: [u8; 20],
16484}
16485impl GPS_STATUS_DATA {
16486 pub const ENCODED_LEN: usize = 101usize;
16487 pub const DEFAULT: Self = Self {
16488 satellites_visible: 0_u8,
16489 satellite_prn: [0_u8; 20usize],
16490 satellite_used: [0_u8; 20usize],
16491 satellite_elevation: [0_u8; 20usize],
16492 satellite_azimuth: [0_u8; 20usize],
16493 satellite_snr: [0_u8; 20usize],
16494 };
16495 #[cfg(feature = "arbitrary")]
16496 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16497 use arbitrary::{Arbitrary, Unstructured};
16498 let mut buf = [0u8; 1024];
16499 rng.fill_bytes(&mut buf);
16500 let mut unstructured = Unstructured::new(&buf);
16501 Self::arbitrary(&mut unstructured).unwrap_or_default()
16502 }
16503}
16504impl Default for GPS_STATUS_DATA {
16505 fn default() -> Self {
16506 Self::DEFAULT.clone()
16507 }
16508}
16509impl MessageData for GPS_STATUS_DATA {
16510 type Message = MavMessage;
16511 const ID: u32 = 25u32;
16512 const NAME: &'static str = "GPS_STATUS";
16513 const EXTRA_CRC: u8 = 23u8;
16514 const ENCODED_LEN: usize = 101usize;
16515 fn deser(
16516 _version: MavlinkVersion,
16517 __input: &[u8],
16518 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16519 let avail_len = __input.len();
16520 let mut payload_buf = [0; Self::ENCODED_LEN];
16521 let mut buf = if avail_len < Self::ENCODED_LEN {
16522 payload_buf[0..avail_len].copy_from_slice(__input);
16523 Bytes::new(&payload_buf)
16524 } else {
16525 Bytes::new(__input)
16526 };
16527 let mut __struct = Self::default();
16528 __struct.satellites_visible = buf.get_u8()?;
16529 for v in &mut __struct.satellite_prn {
16530 let val = buf.get_u8()?;
16531 *v = val;
16532 }
16533 for v in &mut __struct.satellite_used {
16534 let val = buf.get_u8()?;
16535 *v = val;
16536 }
16537 for v in &mut __struct.satellite_elevation {
16538 let val = buf.get_u8()?;
16539 *v = val;
16540 }
16541 for v in &mut __struct.satellite_azimuth {
16542 let val = buf.get_u8()?;
16543 *v = val;
16544 }
16545 for v in &mut __struct.satellite_snr {
16546 let val = buf.get_u8()?;
16547 *v = val;
16548 }
16549 Ok(__struct)
16550 }
16551 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16552 let mut __tmp = BytesMut::new(bytes);
16553 #[allow(clippy::absurd_extreme_comparisons)]
16554 #[allow(unused_comparisons)]
16555 if __tmp.remaining() < Self::ENCODED_LEN {
16556 panic!(
16557 "buffer is too small (need {} bytes, but got {})",
16558 Self::ENCODED_LEN,
16559 __tmp.remaining(),
16560 )
16561 }
16562 __tmp.put_u8(self.satellites_visible);
16563 for val in &self.satellite_prn {
16564 __tmp.put_u8(*val);
16565 }
16566 for val in &self.satellite_used {
16567 __tmp.put_u8(*val);
16568 }
16569 for val in &self.satellite_elevation {
16570 __tmp.put_u8(*val);
16571 }
16572 for val in &self.satellite_azimuth {
16573 __tmp.put_u8(*val);
16574 }
16575 for val in &self.satellite_snr {
16576 __tmp.put_u8(*val);
16577 }
16578 if matches!(version, MavlinkVersion::V2) {
16579 let len = __tmp.len();
16580 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16581 } else {
16582 __tmp.len()
16583 }
16584 }
16585}
16586#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
16587#[doc = ""]
16588#[doc = "ID: 0"]
16589#[derive(Debug, Clone, PartialEq)]
16590#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16591#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16592#[cfg_attr(feature = "ts", derive(TS))]
16593#[cfg_attr(feature = "ts", ts(export))]
16594pub struct HEARTBEAT_DATA {
16595 #[doc = "A bitfield for use for autopilot-specific flags"]
16596 pub custom_mode: u32,
16597 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
16598 pub mavtype: MavType,
16599 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
16600 pub autopilot: MavAutopilot,
16601 #[doc = "System mode bitmap."]
16602 pub base_mode: MavModeFlag,
16603 #[doc = "System status flag."]
16604 pub system_status: MavState,
16605 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
16606 pub mavlink_version: u8,
16607}
16608impl HEARTBEAT_DATA {
16609 pub const ENCODED_LEN: usize = 9usize;
16610 pub const DEFAULT: Self = Self {
16611 custom_mode: 0_u32,
16612 mavtype: MavType::DEFAULT,
16613 autopilot: MavAutopilot::DEFAULT,
16614 base_mode: MavModeFlag::DEFAULT,
16615 system_status: MavState::DEFAULT,
16616 mavlink_version: MINOR_MAVLINK_VERSION,
16617 };
16618 #[cfg(feature = "arbitrary")]
16619 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16620 use arbitrary::{Arbitrary, Unstructured};
16621 let mut buf = [0u8; 1024];
16622 rng.fill_bytes(&mut buf);
16623 let mut unstructured = Unstructured::new(&buf);
16624 Self::arbitrary(&mut unstructured).unwrap_or_default()
16625 }
16626}
16627impl Default for HEARTBEAT_DATA {
16628 fn default() -> Self {
16629 Self::DEFAULT.clone()
16630 }
16631}
16632impl MessageData for HEARTBEAT_DATA {
16633 type Message = MavMessage;
16634 const ID: u32 = 0u32;
16635 const NAME: &'static str = "HEARTBEAT";
16636 const EXTRA_CRC: u8 = 50u8;
16637 const ENCODED_LEN: usize = 9usize;
16638 fn deser(
16639 _version: MavlinkVersion,
16640 __input: &[u8],
16641 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16642 let avail_len = __input.len();
16643 let mut payload_buf = [0; Self::ENCODED_LEN];
16644 let mut buf = if avail_len < Self::ENCODED_LEN {
16645 payload_buf[0..avail_len].copy_from_slice(__input);
16646 Bytes::new(&payload_buf)
16647 } else {
16648 Bytes::new(__input)
16649 };
16650 let mut __struct = Self::default();
16651 __struct.custom_mode = buf.get_u32_le()?;
16652 let tmp = buf.get_u8()?;
16653 __struct.mavtype =
16654 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16655 enum_type: "MavType",
16656 value: tmp as u64,
16657 })?;
16658 let tmp = buf.get_u8()?;
16659 __struct.autopilot =
16660 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16661 enum_type: "MavAutopilot",
16662 value: tmp as u64,
16663 })?;
16664 let tmp = buf.get_u8()?;
16665 __struct.base_mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
16666 ::mavlink_core::error::ParserError::InvalidFlag {
16667 flag_type: "MavModeFlag",
16668 value: tmp as u64,
16669 },
16670 )?;
16671 let tmp = buf.get_u8()?;
16672 __struct.system_status =
16673 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16674 enum_type: "MavState",
16675 value: tmp as u64,
16676 })?;
16677 __struct.mavlink_version = buf.get_u8()?;
16678 Ok(__struct)
16679 }
16680 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16681 let mut __tmp = BytesMut::new(bytes);
16682 #[allow(clippy::absurd_extreme_comparisons)]
16683 #[allow(unused_comparisons)]
16684 if __tmp.remaining() < Self::ENCODED_LEN {
16685 panic!(
16686 "buffer is too small (need {} bytes, but got {})",
16687 Self::ENCODED_LEN,
16688 __tmp.remaining(),
16689 )
16690 }
16691 __tmp.put_u32_le(self.custom_mode);
16692 __tmp.put_u8(self.mavtype as u8);
16693 __tmp.put_u8(self.autopilot as u8);
16694 __tmp.put_u8(self.base_mode.bits() as u8);
16695 __tmp.put_u8(self.system_status as u8);
16696 __tmp.put_u8(self.mavlink_version);
16697 if matches!(version, MavlinkVersion::V2) {
16698 let len = __tmp.len();
16699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16700 } else {
16701 __tmp.len()
16702 }
16703 }
16704}
16705#[doc = "The IMU readings in SI units in NED body frame."]
16706#[doc = ""]
16707#[doc = "ID: 105"]
16708#[derive(Debug, Clone, PartialEq)]
16709#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16710#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16711#[cfg_attr(feature = "ts", derive(TS))]
16712#[cfg_attr(feature = "ts", ts(export))]
16713pub struct HIGHRES_IMU_DATA {
16714 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16715 pub time_usec: u64,
16716 #[doc = "X acceleration"]
16717 pub xacc: f32,
16718 #[doc = "Y acceleration"]
16719 pub yacc: f32,
16720 #[doc = "Z acceleration"]
16721 pub zacc: f32,
16722 #[doc = "Angular speed around X axis"]
16723 pub xgyro: f32,
16724 #[doc = "Angular speed around Y axis"]
16725 pub ygyro: f32,
16726 #[doc = "Angular speed around Z axis"]
16727 pub zgyro: f32,
16728 #[doc = "X Magnetic field"]
16729 pub xmag: f32,
16730 #[doc = "Y Magnetic field"]
16731 pub ymag: f32,
16732 #[doc = "Z Magnetic field"]
16733 pub zmag: f32,
16734 #[doc = "Absolute pressure"]
16735 pub abs_pressure: f32,
16736 #[doc = "Differential pressure"]
16737 pub diff_pressure: f32,
16738 #[doc = "Altitude calculated from pressure"]
16739 pub pressure_alt: f32,
16740 #[doc = "Temperature"]
16741 pub temperature: f32,
16742 #[doc = "Bitmap for fields that have updated since last message"]
16743 pub fields_updated: HighresImuUpdatedFlags,
16744 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
16745 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16746 pub id: u8,
16747}
16748impl HIGHRES_IMU_DATA {
16749 pub const ENCODED_LEN: usize = 63usize;
16750 pub const DEFAULT: Self = Self {
16751 time_usec: 0_u64,
16752 xacc: 0.0_f32,
16753 yacc: 0.0_f32,
16754 zacc: 0.0_f32,
16755 xgyro: 0.0_f32,
16756 ygyro: 0.0_f32,
16757 zgyro: 0.0_f32,
16758 xmag: 0.0_f32,
16759 ymag: 0.0_f32,
16760 zmag: 0.0_f32,
16761 abs_pressure: 0.0_f32,
16762 diff_pressure: 0.0_f32,
16763 pressure_alt: 0.0_f32,
16764 temperature: 0.0_f32,
16765 fields_updated: HighresImuUpdatedFlags::DEFAULT,
16766 id: 0_u8,
16767 };
16768 #[cfg(feature = "arbitrary")]
16769 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16770 use arbitrary::{Arbitrary, Unstructured};
16771 let mut buf = [0u8; 1024];
16772 rng.fill_bytes(&mut buf);
16773 let mut unstructured = Unstructured::new(&buf);
16774 Self::arbitrary(&mut unstructured).unwrap_or_default()
16775 }
16776}
16777impl Default for HIGHRES_IMU_DATA {
16778 fn default() -> Self {
16779 Self::DEFAULT.clone()
16780 }
16781}
16782impl MessageData for HIGHRES_IMU_DATA {
16783 type Message = MavMessage;
16784 const ID: u32 = 105u32;
16785 const NAME: &'static str = "HIGHRES_IMU";
16786 const EXTRA_CRC: u8 = 93u8;
16787 const ENCODED_LEN: usize = 63usize;
16788 fn deser(
16789 _version: MavlinkVersion,
16790 __input: &[u8],
16791 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16792 let avail_len = __input.len();
16793 let mut payload_buf = [0; Self::ENCODED_LEN];
16794 let mut buf = if avail_len < Self::ENCODED_LEN {
16795 payload_buf[0..avail_len].copy_from_slice(__input);
16796 Bytes::new(&payload_buf)
16797 } else {
16798 Bytes::new(__input)
16799 };
16800 let mut __struct = Self::default();
16801 __struct.time_usec = buf.get_u64_le()?;
16802 __struct.xacc = buf.get_f32_le()?;
16803 __struct.yacc = buf.get_f32_le()?;
16804 __struct.zacc = buf.get_f32_le()?;
16805 __struct.xgyro = buf.get_f32_le()?;
16806 __struct.ygyro = buf.get_f32_le()?;
16807 __struct.zgyro = buf.get_f32_le()?;
16808 __struct.xmag = buf.get_f32_le()?;
16809 __struct.ymag = buf.get_f32_le()?;
16810 __struct.zmag = buf.get_f32_le()?;
16811 __struct.abs_pressure = buf.get_f32_le()?;
16812 __struct.diff_pressure = buf.get_f32_le()?;
16813 __struct.pressure_alt = buf.get_f32_le()?;
16814 __struct.temperature = buf.get_f32_le()?;
16815 let tmp = buf.get_u16_le()?;
16816 __struct.fields_updated =
16817 HighresImuUpdatedFlags::from_bits(tmp as <HighresImuUpdatedFlags as Flags>::Bits)
16818 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16819 flag_type: "HighresImuUpdatedFlags",
16820 value: tmp as u64,
16821 })?;
16822 __struct.id = buf.get_u8()?;
16823 Ok(__struct)
16824 }
16825 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16826 let mut __tmp = BytesMut::new(bytes);
16827 #[allow(clippy::absurd_extreme_comparisons)]
16828 #[allow(unused_comparisons)]
16829 if __tmp.remaining() < Self::ENCODED_LEN {
16830 panic!(
16831 "buffer is too small (need {} bytes, but got {})",
16832 Self::ENCODED_LEN,
16833 __tmp.remaining(),
16834 )
16835 }
16836 __tmp.put_u64_le(self.time_usec);
16837 __tmp.put_f32_le(self.xacc);
16838 __tmp.put_f32_le(self.yacc);
16839 __tmp.put_f32_le(self.zacc);
16840 __tmp.put_f32_le(self.xgyro);
16841 __tmp.put_f32_le(self.ygyro);
16842 __tmp.put_f32_le(self.zgyro);
16843 __tmp.put_f32_le(self.xmag);
16844 __tmp.put_f32_le(self.ymag);
16845 __tmp.put_f32_le(self.zmag);
16846 __tmp.put_f32_le(self.abs_pressure);
16847 __tmp.put_f32_le(self.diff_pressure);
16848 __tmp.put_f32_le(self.pressure_alt);
16849 __tmp.put_f32_le(self.temperature);
16850 __tmp.put_u16_le(self.fields_updated.bits() as u16);
16851 if matches!(version, MavlinkVersion::V2) {
16852 __tmp.put_u8(self.id);
16853 let len = __tmp.len();
16854 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16855 } else {
16856 __tmp.len()
16857 }
16858 }
16859}
16860#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
16861#[doc = "Message appropriate for high latency connections like Iridium."]
16862#[doc = ""]
16863#[doc = "ID: 234"]
16864#[derive(Debug, Clone, PartialEq)]
16865#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16866#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16867#[cfg_attr(feature = "ts", derive(TS))]
16868#[cfg_attr(feature = "ts", ts(export))]
16869pub struct HIGH_LATENCY_DATA {
16870 #[doc = "A bitfield for use for autopilot-specific flags."]
16871 pub custom_mode: u32,
16872 #[doc = "Latitude"]
16873 pub latitude: i32,
16874 #[doc = "Longitude"]
16875 pub longitude: i32,
16876 #[doc = "roll"]
16877 pub roll: i16,
16878 #[doc = "pitch"]
16879 pub pitch: i16,
16880 #[doc = "heading"]
16881 pub heading: u16,
16882 #[doc = "heading setpoint"]
16883 pub heading_sp: i16,
16884 #[doc = "Altitude above mean sea level"]
16885 pub altitude_amsl: i16,
16886 #[doc = "Altitude setpoint relative to the home position"]
16887 pub altitude_sp: i16,
16888 #[doc = "distance to target"]
16889 pub wp_distance: u16,
16890 #[doc = "Bitmap of enabled system modes."]
16891 pub base_mode: MavModeFlag,
16892 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
16893 pub landed_state: MavLandedState,
16894 #[doc = "throttle (percentage)"]
16895 pub throttle: i8,
16896 #[doc = "airspeed"]
16897 pub airspeed: u8,
16898 #[doc = "airspeed setpoint"]
16899 pub airspeed_sp: u8,
16900 #[doc = "groundspeed"]
16901 pub groundspeed: u8,
16902 #[doc = "climb rate"]
16903 pub climb_rate: i8,
16904 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16905 pub gps_nsat: u8,
16906 #[doc = "GPS Fix type."]
16907 pub gps_fix_type: GpsFixType,
16908 #[doc = "Remaining battery (percentage)"]
16909 pub battery_remaining: u8,
16910 #[doc = "Autopilot temperature (degrees C)"]
16911 pub temperature: i8,
16912 #[doc = "Air temperature (degrees C) from airspeed sensor"]
16913 pub temperature_air: i8,
16914 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
16915 pub failsafe: u8,
16916 #[doc = "current waypoint number"]
16917 pub wp_num: u8,
16918}
16919impl HIGH_LATENCY_DATA {
16920 pub const ENCODED_LEN: usize = 40usize;
16921 pub const DEFAULT: Self = Self {
16922 custom_mode: 0_u32,
16923 latitude: 0_i32,
16924 longitude: 0_i32,
16925 roll: 0_i16,
16926 pitch: 0_i16,
16927 heading: 0_u16,
16928 heading_sp: 0_i16,
16929 altitude_amsl: 0_i16,
16930 altitude_sp: 0_i16,
16931 wp_distance: 0_u16,
16932 base_mode: MavModeFlag::DEFAULT,
16933 landed_state: MavLandedState::DEFAULT,
16934 throttle: 0_i8,
16935 airspeed: 0_u8,
16936 airspeed_sp: 0_u8,
16937 groundspeed: 0_u8,
16938 climb_rate: 0_i8,
16939 gps_nsat: 0_u8,
16940 gps_fix_type: GpsFixType::DEFAULT,
16941 battery_remaining: 0_u8,
16942 temperature: 0_i8,
16943 temperature_air: 0_i8,
16944 failsafe: 0_u8,
16945 wp_num: 0_u8,
16946 };
16947 #[cfg(feature = "arbitrary")]
16948 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16949 use arbitrary::{Arbitrary, Unstructured};
16950 let mut buf = [0u8; 1024];
16951 rng.fill_bytes(&mut buf);
16952 let mut unstructured = Unstructured::new(&buf);
16953 Self::arbitrary(&mut unstructured).unwrap_or_default()
16954 }
16955}
16956impl Default for HIGH_LATENCY_DATA {
16957 fn default() -> Self {
16958 Self::DEFAULT.clone()
16959 }
16960}
16961impl MessageData for HIGH_LATENCY_DATA {
16962 type Message = MavMessage;
16963 const ID: u32 = 234u32;
16964 const NAME: &'static str = "HIGH_LATENCY";
16965 const EXTRA_CRC: u8 = 150u8;
16966 const ENCODED_LEN: usize = 40usize;
16967 fn deser(
16968 _version: MavlinkVersion,
16969 __input: &[u8],
16970 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16971 let avail_len = __input.len();
16972 let mut payload_buf = [0; Self::ENCODED_LEN];
16973 let mut buf = if avail_len < Self::ENCODED_LEN {
16974 payload_buf[0..avail_len].copy_from_slice(__input);
16975 Bytes::new(&payload_buf)
16976 } else {
16977 Bytes::new(__input)
16978 };
16979 let mut __struct = Self::default();
16980 __struct.custom_mode = buf.get_u32_le()?;
16981 __struct.latitude = buf.get_i32_le()?;
16982 __struct.longitude = buf.get_i32_le()?;
16983 __struct.roll = buf.get_i16_le()?;
16984 __struct.pitch = buf.get_i16_le()?;
16985 __struct.heading = buf.get_u16_le()?;
16986 __struct.heading_sp = buf.get_i16_le()?;
16987 __struct.altitude_amsl = buf.get_i16_le()?;
16988 __struct.altitude_sp = buf.get_i16_le()?;
16989 __struct.wp_distance = buf.get_u16_le()?;
16990 let tmp = buf.get_u8()?;
16991 __struct.base_mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
16992 ::mavlink_core::error::ParserError::InvalidFlag {
16993 flag_type: "MavModeFlag",
16994 value: tmp as u64,
16995 },
16996 )?;
16997 let tmp = buf.get_u8()?;
16998 __struct.landed_state =
16999 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17000 enum_type: "MavLandedState",
17001 value: tmp as u64,
17002 })?;
17003 __struct.throttle = buf.get_i8()?;
17004 __struct.airspeed = buf.get_u8()?;
17005 __struct.airspeed_sp = buf.get_u8()?;
17006 __struct.groundspeed = buf.get_u8()?;
17007 __struct.climb_rate = buf.get_i8()?;
17008 __struct.gps_nsat = buf.get_u8()?;
17009 let tmp = buf.get_u8()?;
17010 __struct.gps_fix_type =
17011 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17012 enum_type: "GpsFixType",
17013 value: tmp as u64,
17014 })?;
17015 __struct.battery_remaining = buf.get_u8()?;
17016 __struct.temperature = buf.get_i8()?;
17017 __struct.temperature_air = buf.get_i8()?;
17018 __struct.failsafe = buf.get_u8()?;
17019 __struct.wp_num = buf.get_u8()?;
17020 Ok(__struct)
17021 }
17022 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17023 let mut __tmp = BytesMut::new(bytes);
17024 #[allow(clippy::absurd_extreme_comparisons)]
17025 #[allow(unused_comparisons)]
17026 if __tmp.remaining() < Self::ENCODED_LEN {
17027 panic!(
17028 "buffer is too small (need {} bytes, but got {})",
17029 Self::ENCODED_LEN,
17030 __tmp.remaining(),
17031 )
17032 }
17033 __tmp.put_u32_le(self.custom_mode);
17034 __tmp.put_i32_le(self.latitude);
17035 __tmp.put_i32_le(self.longitude);
17036 __tmp.put_i16_le(self.roll);
17037 __tmp.put_i16_le(self.pitch);
17038 __tmp.put_u16_le(self.heading);
17039 __tmp.put_i16_le(self.heading_sp);
17040 __tmp.put_i16_le(self.altitude_amsl);
17041 __tmp.put_i16_le(self.altitude_sp);
17042 __tmp.put_u16_le(self.wp_distance);
17043 __tmp.put_u8(self.base_mode.bits() as u8);
17044 __tmp.put_u8(self.landed_state as u8);
17045 __tmp.put_i8(self.throttle);
17046 __tmp.put_u8(self.airspeed);
17047 __tmp.put_u8(self.airspeed_sp);
17048 __tmp.put_u8(self.groundspeed);
17049 __tmp.put_i8(self.climb_rate);
17050 __tmp.put_u8(self.gps_nsat);
17051 __tmp.put_u8(self.gps_fix_type as u8);
17052 __tmp.put_u8(self.battery_remaining);
17053 __tmp.put_i8(self.temperature);
17054 __tmp.put_i8(self.temperature_air);
17055 __tmp.put_u8(self.failsafe);
17056 __tmp.put_u8(self.wp_num);
17057 if matches!(version, MavlinkVersion::V2) {
17058 let len = __tmp.len();
17059 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17060 } else {
17061 __tmp.len()
17062 }
17063 }
17064}
17065#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
17066#[doc = ""]
17067#[doc = "ID: 235"]
17068#[derive(Debug, Clone, PartialEq)]
17069#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17070#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17071#[cfg_attr(feature = "ts", derive(TS))]
17072#[cfg_attr(feature = "ts", ts(export))]
17073pub struct HIGH_LATENCY2_DATA {
17074 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
17075 pub timestamp: u32,
17076 #[doc = "Latitude"]
17077 pub latitude: i32,
17078 #[doc = "Longitude"]
17079 pub longitude: i32,
17080 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
17081 pub custom_mode: u16,
17082 #[doc = "Altitude above mean sea level"]
17083 pub altitude: i16,
17084 #[doc = "Altitude setpoint"]
17085 pub target_altitude: i16,
17086 #[doc = "Distance to target waypoint or position"]
17087 pub target_distance: u16,
17088 #[doc = "Current waypoint number"]
17089 pub wp_num: u16,
17090 #[doc = "Bitmap of failure flags."]
17091 pub failure_flags: HlFailureFlag,
17092 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
17093 pub mavtype: MavType,
17094 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
17095 pub autopilot: MavAutopilot,
17096 #[doc = "Heading"]
17097 pub heading: u8,
17098 #[doc = "Heading setpoint"]
17099 pub target_heading: u8,
17100 #[doc = "Throttle"]
17101 pub throttle: u8,
17102 #[doc = "Airspeed"]
17103 pub airspeed: u8,
17104 #[doc = "Airspeed setpoint"]
17105 pub airspeed_sp: u8,
17106 #[doc = "Groundspeed"]
17107 pub groundspeed: u8,
17108 #[doc = "Windspeed"]
17109 pub windspeed: u8,
17110 #[doc = "Wind heading"]
17111 pub wind_heading: u8,
17112 #[doc = "Maximum error horizontal position since last message"]
17113 pub eph: u8,
17114 #[doc = "Maximum error vertical position since last message"]
17115 pub epv: u8,
17116 #[doc = "Air temperature"]
17117 pub temperature_air: i8,
17118 #[doc = "Maximum climb rate magnitude since last message"]
17119 pub climb_rate: i8,
17120 #[doc = "Battery level (-1 if field not provided)."]
17121 pub battery: i8,
17122 #[doc = "Field for custom payload."]
17123 pub custom0: i8,
17124 #[doc = "Field for custom payload."]
17125 pub custom1: i8,
17126 #[doc = "Field for custom payload."]
17127 pub custom2: i8,
17128}
17129impl HIGH_LATENCY2_DATA {
17130 pub const ENCODED_LEN: usize = 42usize;
17131 pub const DEFAULT: Self = Self {
17132 timestamp: 0_u32,
17133 latitude: 0_i32,
17134 longitude: 0_i32,
17135 custom_mode: 0_u16,
17136 altitude: 0_i16,
17137 target_altitude: 0_i16,
17138 target_distance: 0_u16,
17139 wp_num: 0_u16,
17140 failure_flags: HlFailureFlag::DEFAULT,
17141 mavtype: MavType::DEFAULT,
17142 autopilot: MavAutopilot::DEFAULT,
17143 heading: 0_u8,
17144 target_heading: 0_u8,
17145 throttle: 0_u8,
17146 airspeed: 0_u8,
17147 airspeed_sp: 0_u8,
17148 groundspeed: 0_u8,
17149 windspeed: 0_u8,
17150 wind_heading: 0_u8,
17151 eph: 0_u8,
17152 epv: 0_u8,
17153 temperature_air: 0_i8,
17154 climb_rate: 0_i8,
17155 battery: 0_i8,
17156 custom0: 0_i8,
17157 custom1: 0_i8,
17158 custom2: 0_i8,
17159 };
17160 #[cfg(feature = "arbitrary")]
17161 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17162 use arbitrary::{Arbitrary, Unstructured};
17163 let mut buf = [0u8; 1024];
17164 rng.fill_bytes(&mut buf);
17165 let mut unstructured = Unstructured::new(&buf);
17166 Self::arbitrary(&mut unstructured).unwrap_or_default()
17167 }
17168}
17169impl Default for HIGH_LATENCY2_DATA {
17170 fn default() -> Self {
17171 Self::DEFAULT.clone()
17172 }
17173}
17174impl MessageData for HIGH_LATENCY2_DATA {
17175 type Message = MavMessage;
17176 const ID: u32 = 235u32;
17177 const NAME: &'static str = "HIGH_LATENCY2";
17178 const EXTRA_CRC: u8 = 179u8;
17179 const ENCODED_LEN: usize = 42usize;
17180 fn deser(
17181 _version: MavlinkVersion,
17182 __input: &[u8],
17183 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17184 let avail_len = __input.len();
17185 let mut payload_buf = [0; Self::ENCODED_LEN];
17186 let mut buf = if avail_len < Self::ENCODED_LEN {
17187 payload_buf[0..avail_len].copy_from_slice(__input);
17188 Bytes::new(&payload_buf)
17189 } else {
17190 Bytes::new(__input)
17191 };
17192 let mut __struct = Self::default();
17193 __struct.timestamp = buf.get_u32_le()?;
17194 __struct.latitude = buf.get_i32_le()?;
17195 __struct.longitude = buf.get_i32_le()?;
17196 __struct.custom_mode = buf.get_u16_le()?;
17197 __struct.altitude = buf.get_i16_le()?;
17198 __struct.target_altitude = buf.get_i16_le()?;
17199 __struct.target_distance = buf.get_u16_le()?;
17200 __struct.wp_num = buf.get_u16_le()?;
17201 let tmp = buf.get_u16_le()?;
17202 __struct.failure_flags = HlFailureFlag::from_bits(tmp as <HlFailureFlag as Flags>::Bits)
17203 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17204 flag_type: "HlFailureFlag",
17205 value: tmp as u64,
17206 })?;
17207 let tmp = buf.get_u8()?;
17208 __struct.mavtype =
17209 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17210 enum_type: "MavType",
17211 value: tmp as u64,
17212 })?;
17213 let tmp = buf.get_u8()?;
17214 __struct.autopilot =
17215 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17216 enum_type: "MavAutopilot",
17217 value: tmp as u64,
17218 })?;
17219 __struct.heading = buf.get_u8()?;
17220 __struct.target_heading = buf.get_u8()?;
17221 __struct.throttle = buf.get_u8()?;
17222 __struct.airspeed = buf.get_u8()?;
17223 __struct.airspeed_sp = buf.get_u8()?;
17224 __struct.groundspeed = buf.get_u8()?;
17225 __struct.windspeed = buf.get_u8()?;
17226 __struct.wind_heading = buf.get_u8()?;
17227 __struct.eph = buf.get_u8()?;
17228 __struct.epv = buf.get_u8()?;
17229 __struct.temperature_air = buf.get_i8()?;
17230 __struct.climb_rate = buf.get_i8()?;
17231 __struct.battery = buf.get_i8()?;
17232 __struct.custom0 = buf.get_i8()?;
17233 __struct.custom1 = buf.get_i8()?;
17234 __struct.custom2 = buf.get_i8()?;
17235 Ok(__struct)
17236 }
17237 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17238 let mut __tmp = BytesMut::new(bytes);
17239 #[allow(clippy::absurd_extreme_comparisons)]
17240 #[allow(unused_comparisons)]
17241 if __tmp.remaining() < Self::ENCODED_LEN {
17242 panic!(
17243 "buffer is too small (need {} bytes, but got {})",
17244 Self::ENCODED_LEN,
17245 __tmp.remaining(),
17246 )
17247 }
17248 __tmp.put_u32_le(self.timestamp);
17249 __tmp.put_i32_le(self.latitude);
17250 __tmp.put_i32_le(self.longitude);
17251 __tmp.put_u16_le(self.custom_mode);
17252 __tmp.put_i16_le(self.altitude);
17253 __tmp.put_i16_le(self.target_altitude);
17254 __tmp.put_u16_le(self.target_distance);
17255 __tmp.put_u16_le(self.wp_num);
17256 __tmp.put_u16_le(self.failure_flags.bits() as u16);
17257 __tmp.put_u8(self.mavtype as u8);
17258 __tmp.put_u8(self.autopilot as u8);
17259 __tmp.put_u8(self.heading);
17260 __tmp.put_u8(self.target_heading);
17261 __tmp.put_u8(self.throttle);
17262 __tmp.put_u8(self.airspeed);
17263 __tmp.put_u8(self.airspeed_sp);
17264 __tmp.put_u8(self.groundspeed);
17265 __tmp.put_u8(self.windspeed);
17266 __tmp.put_u8(self.wind_heading);
17267 __tmp.put_u8(self.eph);
17268 __tmp.put_u8(self.epv);
17269 __tmp.put_i8(self.temperature_air);
17270 __tmp.put_i8(self.climb_rate);
17271 __tmp.put_i8(self.battery);
17272 __tmp.put_i8(self.custom0);
17273 __tmp.put_i8(self.custom1);
17274 __tmp.put_i8(self.custom2);
17275 if matches!(version, MavlinkVersion::V2) {
17276 let len = __tmp.len();
17277 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17278 } else {
17279 __tmp.len()
17280 }
17281 }
17282}
17283#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
17284#[doc = ""]
17285#[doc = "ID: 93"]
17286#[derive(Debug, Clone, PartialEq)]
17287#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17288#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17289#[cfg_attr(feature = "ts", derive(TS))]
17290#[cfg_attr(feature = "ts", ts(export))]
17291pub struct HIL_ACTUATOR_CONTROLS_DATA {
17292 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17293 pub time_usec: u64,
17294 #[doc = "Flags bitmask."]
17295 pub flags: HilActuatorControlsFlags,
17296 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
17297 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17298 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17299 pub controls: [f32; 16],
17300 #[doc = "System mode. Includes arming state."]
17301 pub mode: MavModeFlag,
17302}
17303impl HIL_ACTUATOR_CONTROLS_DATA {
17304 pub const ENCODED_LEN: usize = 81usize;
17305 pub const DEFAULT: Self = Self {
17306 time_usec: 0_u64,
17307 flags: HilActuatorControlsFlags::DEFAULT,
17308 controls: [0.0_f32; 16usize],
17309 mode: MavModeFlag::DEFAULT,
17310 };
17311 #[cfg(feature = "arbitrary")]
17312 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17313 use arbitrary::{Arbitrary, Unstructured};
17314 let mut buf = [0u8; 1024];
17315 rng.fill_bytes(&mut buf);
17316 let mut unstructured = Unstructured::new(&buf);
17317 Self::arbitrary(&mut unstructured).unwrap_or_default()
17318 }
17319}
17320impl Default for HIL_ACTUATOR_CONTROLS_DATA {
17321 fn default() -> Self {
17322 Self::DEFAULT.clone()
17323 }
17324}
17325impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
17326 type Message = MavMessage;
17327 const ID: u32 = 93u32;
17328 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
17329 const EXTRA_CRC: u8 = 47u8;
17330 const ENCODED_LEN: usize = 81usize;
17331 fn deser(
17332 _version: MavlinkVersion,
17333 __input: &[u8],
17334 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17335 let avail_len = __input.len();
17336 let mut payload_buf = [0; Self::ENCODED_LEN];
17337 let mut buf = if avail_len < Self::ENCODED_LEN {
17338 payload_buf[0..avail_len].copy_from_slice(__input);
17339 Bytes::new(&payload_buf)
17340 } else {
17341 Bytes::new(__input)
17342 };
17343 let mut __struct = Self::default();
17344 __struct.time_usec = buf.get_u64_le()?;
17345 let tmp = buf.get_u64_le()?;
17346 __struct.flags =
17347 HilActuatorControlsFlags::from_bits(tmp as <HilActuatorControlsFlags as Flags>::Bits)
17348 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17349 flag_type: "HilActuatorControlsFlags",
17350 value: tmp as u64,
17351 })?;
17352 for v in &mut __struct.controls {
17353 let val = buf.get_f32_le()?;
17354 *v = val;
17355 }
17356 let tmp = buf.get_u8()?;
17357 __struct.mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
17358 ::mavlink_core::error::ParserError::InvalidFlag {
17359 flag_type: "MavModeFlag",
17360 value: tmp as u64,
17361 },
17362 )?;
17363 Ok(__struct)
17364 }
17365 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17366 let mut __tmp = BytesMut::new(bytes);
17367 #[allow(clippy::absurd_extreme_comparisons)]
17368 #[allow(unused_comparisons)]
17369 if __tmp.remaining() < Self::ENCODED_LEN {
17370 panic!(
17371 "buffer is too small (need {} bytes, but got {})",
17372 Self::ENCODED_LEN,
17373 __tmp.remaining(),
17374 )
17375 }
17376 __tmp.put_u64_le(self.time_usec);
17377 __tmp.put_u64_le(self.flags.bits() as u64);
17378 for val in &self.controls {
17379 __tmp.put_f32_le(*val);
17380 }
17381 __tmp.put_u8(self.mode.bits() as u8);
17382 if matches!(version, MavlinkVersion::V2) {
17383 let len = __tmp.len();
17384 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17385 } else {
17386 __tmp.len()
17387 }
17388 }
17389}
17390#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
17391#[doc = ""]
17392#[doc = "ID: 91"]
17393#[derive(Debug, Clone, PartialEq)]
17394#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17395#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17396#[cfg_attr(feature = "ts", derive(TS))]
17397#[cfg_attr(feature = "ts", ts(export))]
17398pub struct HIL_CONTROLS_DATA {
17399 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17400 pub time_usec: u64,
17401 #[doc = "Control output -1 .. 1"]
17402 pub roll_ailerons: f32,
17403 #[doc = "Control output -1 .. 1"]
17404 pub pitch_elevator: f32,
17405 #[doc = "Control output -1 .. 1"]
17406 pub yaw_rudder: f32,
17407 #[doc = "Throttle 0 .. 1"]
17408 pub throttle: f32,
17409 #[doc = "Aux 1, -1 .. 1"]
17410 pub aux1: f32,
17411 #[doc = "Aux 2, -1 .. 1"]
17412 pub aux2: f32,
17413 #[doc = "Aux 3, -1 .. 1"]
17414 pub aux3: f32,
17415 #[doc = "Aux 4, -1 .. 1"]
17416 pub aux4: f32,
17417 #[doc = "System mode."]
17418 pub mode: MavMode,
17419 #[doc = "Navigation mode (MAV_NAV_MODE)"]
17420 pub nav_mode: u8,
17421}
17422impl HIL_CONTROLS_DATA {
17423 pub const ENCODED_LEN: usize = 42usize;
17424 pub const DEFAULT: Self = Self {
17425 time_usec: 0_u64,
17426 roll_ailerons: 0.0_f32,
17427 pitch_elevator: 0.0_f32,
17428 yaw_rudder: 0.0_f32,
17429 throttle: 0.0_f32,
17430 aux1: 0.0_f32,
17431 aux2: 0.0_f32,
17432 aux3: 0.0_f32,
17433 aux4: 0.0_f32,
17434 mode: MavMode::DEFAULT,
17435 nav_mode: 0_u8,
17436 };
17437 #[cfg(feature = "arbitrary")]
17438 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17439 use arbitrary::{Arbitrary, Unstructured};
17440 let mut buf = [0u8; 1024];
17441 rng.fill_bytes(&mut buf);
17442 let mut unstructured = Unstructured::new(&buf);
17443 Self::arbitrary(&mut unstructured).unwrap_or_default()
17444 }
17445}
17446impl Default for HIL_CONTROLS_DATA {
17447 fn default() -> Self {
17448 Self::DEFAULT.clone()
17449 }
17450}
17451impl MessageData for HIL_CONTROLS_DATA {
17452 type Message = MavMessage;
17453 const ID: u32 = 91u32;
17454 const NAME: &'static str = "HIL_CONTROLS";
17455 const EXTRA_CRC: u8 = 63u8;
17456 const ENCODED_LEN: usize = 42usize;
17457 fn deser(
17458 _version: MavlinkVersion,
17459 __input: &[u8],
17460 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17461 let avail_len = __input.len();
17462 let mut payload_buf = [0; Self::ENCODED_LEN];
17463 let mut buf = if avail_len < Self::ENCODED_LEN {
17464 payload_buf[0..avail_len].copy_from_slice(__input);
17465 Bytes::new(&payload_buf)
17466 } else {
17467 Bytes::new(__input)
17468 };
17469 let mut __struct = Self::default();
17470 __struct.time_usec = buf.get_u64_le()?;
17471 __struct.roll_ailerons = buf.get_f32_le()?;
17472 __struct.pitch_elevator = buf.get_f32_le()?;
17473 __struct.yaw_rudder = buf.get_f32_le()?;
17474 __struct.throttle = buf.get_f32_le()?;
17475 __struct.aux1 = buf.get_f32_le()?;
17476 __struct.aux2 = buf.get_f32_le()?;
17477 __struct.aux3 = buf.get_f32_le()?;
17478 __struct.aux4 = buf.get_f32_le()?;
17479 let tmp = buf.get_u8()?;
17480 __struct.mode =
17481 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17482 enum_type: "MavMode",
17483 value: tmp as u64,
17484 })?;
17485 __struct.nav_mode = buf.get_u8()?;
17486 Ok(__struct)
17487 }
17488 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17489 let mut __tmp = BytesMut::new(bytes);
17490 #[allow(clippy::absurd_extreme_comparisons)]
17491 #[allow(unused_comparisons)]
17492 if __tmp.remaining() < Self::ENCODED_LEN {
17493 panic!(
17494 "buffer is too small (need {} bytes, but got {})",
17495 Self::ENCODED_LEN,
17496 __tmp.remaining(),
17497 )
17498 }
17499 __tmp.put_u64_le(self.time_usec);
17500 __tmp.put_f32_le(self.roll_ailerons);
17501 __tmp.put_f32_le(self.pitch_elevator);
17502 __tmp.put_f32_le(self.yaw_rudder);
17503 __tmp.put_f32_le(self.throttle);
17504 __tmp.put_f32_le(self.aux1);
17505 __tmp.put_f32_le(self.aux2);
17506 __tmp.put_f32_le(self.aux3);
17507 __tmp.put_f32_le(self.aux4);
17508 __tmp.put_u8(self.mode as u8);
17509 __tmp.put_u8(self.nav_mode);
17510 if matches!(version, MavlinkVersion::V2) {
17511 let len = __tmp.len();
17512 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17513 } else {
17514 __tmp.len()
17515 }
17516 }
17517}
17518#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
17519#[doc = ""]
17520#[doc = "ID: 113"]
17521#[derive(Debug, Clone, PartialEq)]
17522#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17523#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17524#[cfg_attr(feature = "ts", derive(TS))]
17525#[cfg_attr(feature = "ts", ts(export))]
17526pub struct HIL_GPS_DATA {
17527 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17528 pub time_usec: u64,
17529 #[doc = "Latitude (WGS84)"]
17530 pub lat: i32,
17531 #[doc = "Longitude (WGS84)"]
17532 pub lon: i32,
17533 #[doc = "Altitude (MSL). Positive for up."]
17534 pub alt: i32,
17535 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
17536 pub eph: u16,
17537 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
17538 pub epv: u16,
17539 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
17540 pub vel: u16,
17541 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
17542 pub vn: i16,
17543 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
17544 pub ve: i16,
17545 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
17546 pub vd: i16,
17547 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
17548 pub cog: u16,
17549 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
17550 pub fix_type: u8,
17551 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
17552 pub satellites_visible: u8,
17553 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
17554 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17555 pub id: u8,
17556 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
17557 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17558 pub yaw: u16,
17559}
17560impl HIL_GPS_DATA {
17561 pub const ENCODED_LEN: usize = 39usize;
17562 pub const DEFAULT: Self = Self {
17563 time_usec: 0_u64,
17564 lat: 0_i32,
17565 lon: 0_i32,
17566 alt: 0_i32,
17567 eph: 0_u16,
17568 epv: 0_u16,
17569 vel: 0_u16,
17570 vn: 0_i16,
17571 ve: 0_i16,
17572 vd: 0_i16,
17573 cog: 0_u16,
17574 fix_type: 0_u8,
17575 satellites_visible: 0_u8,
17576 id: 0_u8,
17577 yaw: 0_u16,
17578 };
17579 #[cfg(feature = "arbitrary")]
17580 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17581 use arbitrary::{Arbitrary, Unstructured};
17582 let mut buf = [0u8; 1024];
17583 rng.fill_bytes(&mut buf);
17584 let mut unstructured = Unstructured::new(&buf);
17585 Self::arbitrary(&mut unstructured).unwrap_or_default()
17586 }
17587}
17588impl Default for HIL_GPS_DATA {
17589 fn default() -> Self {
17590 Self::DEFAULT.clone()
17591 }
17592}
17593impl MessageData for HIL_GPS_DATA {
17594 type Message = MavMessage;
17595 const ID: u32 = 113u32;
17596 const NAME: &'static str = "HIL_GPS";
17597 const EXTRA_CRC: u8 = 124u8;
17598 const ENCODED_LEN: usize = 39usize;
17599 fn deser(
17600 _version: MavlinkVersion,
17601 __input: &[u8],
17602 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17603 let avail_len = __input.len();
17604 let mut payload_buf = [0; Self::ENCODED_LEN];
17605 let mut buf = if avail_len < Self::ENCODED_LEN {
17606 payload_buf[0..avail_len].copy_from_slice(__input);
17607 Bytes::new(&payload_buf)
17608 } else {
17609 Bytes::new(__input)
17610 };
17611 let mut __struct = Self::default();
17612 __struct.time_usec = buf.get_u64_le()?;
17613 __struct.lat = buf.get_i32_le()?;
17614 __struct.lon = buf.get_i32_le()?;
17615 __struct.alt = buf.get_i32_le()?;
17616 __struct.eph = buf.get_u16_le()?;
17617 __struct.epv = buf.get_u16_le()?;
17618 __struct.vel = buf.get_u16_le()?;
17619 __struct.vn = buf.get_i16_le()?;
17620 __struct.ve = buf.get_i16_le()?;
17621 __struct.vd = buf.get_i16_le()?;
17622 __struct.cog = buf.get_u16_le()?;
17623 __struct.fix_type = buf.get_u8()?;
17624 __struct.satellites_visible = buf.get_u8()?;
17625 __struct.id = buf.get_u8()?;
17626 __struct.yaw = buf.get_u16_le()?;
17627 Ok(__struct)
17628 }
17629 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17630 let mut __tmp = BytesMut::new(bytes);
17631 #[allow(clippy::absurd_extreme_comparisons)]
17632 #[allow(unused_comparisons)]
17633 if __tmp.remaining() < Self::ENCODED_LEN {
17634 panic!(
17635 "buffer is too small (need {} bytes, but got {})",
17636 Self::ENCODED_LEN,
17637 __tmp.remaining(),
17638 )
17639 }
17640 __tmp.put_u64_le(self.time_usec);
17641 __tmp.put_i32_le(self.lat);
17642 __tmp.put_i32_le(self.lon);
17643 __tmp.put_i32_le(self.alt);
17644 __tmp.put_u16_le(self.eph);
17645 __tmp.put_u16_le(self.epv);
17646 __tmp.put_u16_le(self.vel);
17647 __tmp.put_i16_le(self.vn);
17648 __tmp.put_i16_le(self.ve);
17649 __tmp.put_i16_le(self.vd);
17650 __tmp.put_u16_le(self.cog);
17651 __tmp.put_u8(self.fix_type);
17652 __tmp.put_u8(self.satellites_visible);
17653 if matches!(version, MavlinkVersion::V2) {
17654 __tmp.put_u8(self.id);
17655 __tmp.put_u16_le(self.yaw);
17656 let len = __tmp.len();
17657 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17658 } else {
17659 __tmp.len()
17660 }
17661 }
17662}
17663#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
17664#[doc = ""]
17665#[doc = "ID: 114"]
17666#[derive(Debug, Clone, PartialEq)]
17667#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17668#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17669#[cfg_attr(feature = "ts", derive(TS))]
17670#[cfg_attr(feature = "ts", ts(export))]
17671pub struct HIL_OPTICAL_FLOW_DATA {
17672 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17673 pub time_usec: u64,
17674 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
17675 pub integration_time_us: u32,
17676 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
17677 pub integrated_x: f32,
17678 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
17679 pub integrated_y: f32,
17680 #[doc = "RH rotation around X axis"]
17681 pub integrated_xgyro: f32,
17682 #[doc = "RH rotation around Y axis"]
17683 pub integrated_ygyro: f32,
17684 #[doc = "RH rotation around Z axis"]
17685 pub integrated_zgyro: f32,
17686 #[doc = "Time since the distance was sampled."]
17687 pub time_delta_distance_us: u32,
17688 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
17689 pub distance: f32,
17690 #[doc = "Temperature"]
17691 pub temperature: i16,
17692 #[doc = "Sensor ID"]
17693 pub sensor_id: u8,
17694 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
17695 pub quality: u8,
17696}
17697impl HIL_OPTICAL_FLOW_DATA {
17698 pub const ENCODED_LEN: usize = 44usize;
17699 pub const DEFAULT: Self = Self {
17700 time_usec: 0_u64,
17701 integration_time_us: 0_u32,
17702 integrated_x: 0.0_f32,
17703 integrated_y: 0.0_f32,
17704 integrated_xgyro: 0.0_f32,
17705 integrated_ygyro: 0.0_f32,
17706 integrated_zgyro: 0.0_f32,
17707 time_delta_distance_us: 0_u32,
17708 distance: 0.0_f32,
17709 temperature: 0_i16,
17710 sensor_id: 0_u8,
17711 quality: 0_u8,
17712 };
17713 #[cfg(feature = "arbitrary")]
17714 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17715 use arbitrary::{Arbitrary, Unstructured};
17716 let mut buf = [0u8; 1024];
17717 rng.fill_bytes(&mut buf);
17718 let mut unstructured = Unstructured::new(&buf);
17719 Self::arbitrary(&mut unstructured).unwrap_or_default()
17720 }
17721}
17722impl Default for HIL_OPTICAL_FLOW_DATA {
17723 fn default() -> Self {
17724 Self::DEFAULT.clone()
17725 }
17726}
17727impl MessageData for HIL_OPTICAL_FLOW_DATA {
17728 type Message = MavMessage;
17729 const ID: u32 = 114u32;
17730 const NAME: &'static str = "HIL_OPTICAL_FLOW";
17731 const EXTRA_CRC: u8 = 237u8;
17732 const ENCODED_LEN: usize = 44usize;
17733 fn deser(
17734 _version: MavlinkVersion,
17735 __input: &[u8],
17736 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17737 let avail_len = __input.len();
17738 let mut payload_buf = [0; Self::ENCODED_LEN];
17739 let mut buf = if avail_len < Self::ENCODED_LEN {
17740 payload_buf[0..avail_len].copy_from_slice(__input);
17741 Bytes::new(&payload_buf)
17742 } else {
17743 Bytes::new(__input)
17744 };
17745 let mut __struct = Self::default();
17746 __struct.time_usec = buf.get_u64_le()?;
17747 __struct.integration_time_us = buf.get_u32_le()?;
17748 __struct.integrated_x = buf.get_f32_le()?;
17749 __struct.integrated_y = buf.get_f32_le()?;
17750 __struct.integrated_xgyro = buf.get_f32_le()?;
17751 __struct.integrated_ygyro = buf.get_f32_le()?;
17752 __struct.integrated_zgyro = buf.get_f32_le()?;
17753 __struct.time_delta_distance_us = buf.get_u32_le()?;
17754 __struct.distance = buf.get_f32_le()?;
17755 __struct.temperature = buf.get_i16_le()?;
17756 __struct.sensor_id = buf.get_u8()?;
17757 __struct.quality = buf.get_u8()?;
17758 Ok(__struct)
17759 }
17760 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17761 let mut __tmp = BytesMut::new(bytes);
17762 #[allow(clippy::absurd_extreme_comparisons)]
17763 #[allow(unused_comparisons)]
17764 if __tmp.remaining() < Self::ENCODED_LEN {
17765 panic!(
17766 "buffer is too small (need {} bytes, but got {})",
17767 Self::ENCODED_LEN,
17768 __tmp.remaining(),
17769 )
17770 }
17771 __tmp.put_u64_le(self.time_usec);
17772 __tmp.put_u32_le(self.integration_time_us);
17773 __tmp.put_f32_le(self.integrated_x);
17774 __tmp.put_f32_le(self.integrated_y);
17775 __tmp.put_f32_le(self.integrated_xgyro);
17776 __tmp.put_f32_le(self.integrated_ygyro);
17777 __tmp.put_f32_le(self.integrated_zgyro);
17778 __tmp.put_u32_le(self.time_delta_distance_us);
17779 __tmp.put_f32_le(self.distance);
17780 __tmp.put_i16_le(self.temperature);
17781 __tmp.put_u8(self.sensor_id);
17782 __tmp.put_u8(self.quality);
17783 if matches!(version, MavlinkVersion::V2) {
17784 let len = __tmp.len();
17785 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17786 } else {
17787 __tmp.len()
17788 }
17789 }
17790}
17791#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
17792#[doc = ""]
17793#[doc = "ID: 92"]
17794#[derive(Debug, Clone, PartialEq)]
17795#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17796#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17797#[cfg_attr(feature = "ts", derive(TS))]
17798#[cfg_attr(feature = "ts", ts(export))]
17799pub struct HIL_RC_INPUTS_RAW_DATA {
17800 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17801 pub time_usec: u64,
17802 #[doc = "RC channel 1 value"]
17803 pub chan1_raw: u16,
17804 #[doc = "RC channel 2 value"]
17805 pub chan2_raw: u16,
17806 #[doc = "RC channel 3 value"]
17807 pub chan3_raw: u16,
17808 #[doc = "RC channel 4 value"]
17809 pub chan4_raw: u16,
17810 #[doc = "RC channel 5 value"]
17811 pub chan5_raw: u16,
17812 #[doc = "RC channel 6 value"]
17813 pub chan6_raw: u16,
17814 #[doc = "RC channel 7 value"]
17815 pub chan7_raw: u16,
17816 #[doc = "RC channel 8 value"]
17817 pub chan8_raw: u16,
17818 #[doc = "RC channel 9 value"]
17819 pub chan9_raw: u16,
17820 #[doc = "RC channel 10 value"]
17821 pub chan10_raw: u16,
17822 #[doc = "RC channel 11 value"]
17823 pub chan11_raw: u16,
17824 #[doc = "RC channel 12 value"]
17825 pub chan12_raw: u16,
17826 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
17827 pub rssi: u8,
17828}
17829impl HIL_RC_INPUTS_RAW_DATA {
17830 pub const ENCODED_LEN: usize = 33usize;
17831 pub const DEFAULT: Self = Self {
17832 time_usec: 0_u64,
17833 chan1_raw: 0_u16,
17834 chan2_raw: 0_u16,
17835 chan3_raw: 0_u16,
17836 chan4_raw: 0_u16,
17837 chan5_raw: 0_u16,
17838 chan6_raw: 0_u16,
17839 chan7_raw: 0_u16,
17840 chan8_raw: 0_u16,
17841 chan9_raw: 0_u16,
17842 chan10_raw: 0_u16,
17843 chan11_raw: 0_u16,
17844 chan12_raw: 0_u16,
17845 rssi: 0_u8,
17846 };
17847 #[cfg(feature = "arbitrary")]
17848 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17849 use arbitrary::{Arbitrary, Unstructured};
17850 let mut buf = [0u8; 1024];
17851 rng.fill_bytes(&mut buf);
17852 let mut unstructured = Unstructured::new(&buf);
17853 Self::arbitrary(&mut unstructured).unwrap_or_default()
17854 }
17855}
17856impl Default for HIL_RC_INPUTS_RAW_DATA {
17857 fn default() -> Self {
17858 Self::DEFAULT.clone()
17859 }
17860}
17861impl MessageData for HIL_RC_INPUTS_RAW_DATA {
17862 type Message = MavMessage;
17863 const ID: u32 = 92u32;
17864 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
17865 const EXTRA_CRC: u8 = 54u8;
17866 const ENCODED_LEN: usize = 33usize;
17867 fn deser(
17868 _version: MavlinkVersion,
17869 __input: &[u8],
17870 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17871 let avail_len = __input.len();
17872 let mut payload_buf = [0; Self::ENCODED_LEN];
17873 let mut buf = if avail_len < Self::ENCODED_LEN {
17874 payload_buf[0..avail_len].copy_from_slice(__input);
17875 Bytes::new(&payload_buf)
17876 } else {
17877 Bytes::new(__input)
17878 };
17879 let mut __struct = Self::default();
17880 __struct.time_usec = buf.get_u64_le()?;
17881 __struct.chan1_raw = buf.get_u16_le()?;
17882 __struct.chan2_raw = buf.get_u16_le()?;
17883 __struct.chan3_raw = buf.get_u16_le()?;
17884 __struct.chan4_raw = buf.get_u16_le()?;
17885 __struct.chan5_raw = buf.get_u16_le()?;
17886 __struct.chan6_raw = buf.get_u16_le()?;
17887 __struct.chan7_raw = buf.get_u16_le()?;
17888 __struct.chan8_raw = buf.get_u16_le()?;
17889 __struct.chan9_raw = buf.get_u16_le()?;
17890 __struct.chan10_raw = buf.get_u16_le()?;
17891 __struct.chan11_raw = buf.get_u16_le()?;
17892 __struct.chan12_raw = buf.get_u16_le()?;
17893 __struct.rssi = buf.get_u8()?;
17894 Ok(__struct)
17895 }
17896 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17897 let mut __tmp = BytesMut::new(bytes);
17898 #[allow(clippy::absurd_extreme_comparisons)]
17899 #[allow(unused_comparisons)]
17900 if __tmp.remaining() < Self::ENCODED_LEN {
17901 panic!(
17902 "buffer is too small (need {} bytes, but got {})",
17903 Self::ENCODED_LEN,
17904 __tmp.remaining(),
17905 )
17906 }
17907 __tmp.put_u64_le(self.time_usec);
17908 __tmp.put_u16_le(self.chan1_raw);
17909 __tmp.put_u16_le(self.chan2_raw);
17910 __tmp.put_u16_le(self.chan3_raw);
17911 __tmp.put_u16_le(self.chan4_raw);
17912 __tmp.put_u16_le(self.chan5_raw);
17913 __tmp.put_u16_le(self.chan6_raw);
17914 __tmp.put_u16_le(self.chan7_raw);
17915 __tmp.put_u16_le(self.chan8_raw);
17916 __tmp.put_u16_le(self.chan9_raw);
17917 __tmp.put_u16_le(self.chan10_raw);
17918 __tmp.put_u16_le(self.chan11_raw);
17919 __tmp.put_u16_le(self.chan12_raw);
17920 __tmp.put_u8(self.rssi);
17921 if matches!(version, MavlinkVersion::V2) {
17922 let len = __tmp.len();
17923 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17924 } else {
17925 __tmp.len()
17926 }
17927 }
17928}
17929#[doc = "The IMU readings in SI units in NED body frame."]
17930#[doc = ""]
17931#[doc = "ID: 107"]
17932#[derive(Debug, Clone, PartialEq)]
17933#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17934#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17935#[cfg_attr(feature = "ts", derive(TS))]
17936#[cfg_attr(feature = "ts", ts(export))]
17937pub struct HIL_SENSOR_DATA {
17938 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17939 pub time_usec: u64,
17940 #[doc = "X acceleration"]
17941 pub xacc: f32,
17942 #[doc = "Y acceleration"]
17943 pub yacc: f32,
17944 #[doc = "Z acceleration"]
17945 pub zacc: f32,
17946 #[doc = "Angular speed around X axis in body frame"]
17947 pub xgyro: f32,
17948 #[doc = "Angular speed around Y axis in body frame"]
17949 pub ygyro: f32,
17950 #[doc = "Angular speed around Z axis in body frame"]
17951 pub zgyro: f32,
17952 #[doc = "X Magnetic field"]
17953 pub xmag: f32,
17954 #[doc = "Y Magnetic field"]
17955 pub ymag: f32,
17956 #[doc = "Z Magnetic field"]
17957 pub zmag: f32,
17958 #[doc = "Absolute pressure"]
17959 pub abs_pressure: f32,
17960 #[doc = "Differential pressure (airspeed)"]
17961 pub diff_pressure: f32,
17962 #[doc = "Altitude calculated from pressure"]
17963 pub pressure_alt: f32,
17964 #[doc = "Temperature"]
17965 pub temperature: f32,
17966 #[doc = "Bitmap for fields that have updated since last message"]
17967 pub fields_updated: HilSensorUpdatedFlags,
17968 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
17969 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17970 pub id: u8,
17971}
17972impl HIL_SENSOR_DATA {
17973 pub const ENCODED_LEN: usize = 65usize;
17974 pub const DEFAULT: Self = Self {
17975 time_usec: 0_u64,
17976 xacc: 0.0_f32,
17977 yacc: 0.0_f32,
17978 zacc: 0.0_f32,
17979 xgyro: 0.0_f32,
17980 ygyro: 0.0_f32,
17981 zgyro: 0.0_f32,
17982 xmag: 0.0_f32,
17983 ymag: 0.0_f32,
17984 zmag: 0.0_f32,
17985 abs_pressure: 0.0_f32,
17986 diff_pressure: 0.0_f32,
17987 pressure_alt: 0.0_f32,
17988 temperature: 0.0_f32,
17989 fields_updated: HilSensorUpdatedFlags::DEFAULT,
17990 id: 0_u8,
17991 };
17992 #[cfg(feature = "arbitrary")]
17993 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17994 use arbitrary::{Arbitrary, Unstructured};
17995 let mut buf = [0u8; 1024];
17996 rng.fill_bytes(&mut buf);
17997 let mut unstructured = Unstructured::new(&buf);
17998 Self::arbitrary(&mut unstructured).unwrap_or_default()
17999 }
18000}
18001impl Default for HIL_SENSOR_DATA {
18002 fn default() -> Self {
18003 Self::DEFAULT.clone()
18004 }
18005}
18006impl MessageData for HIL_SENSOR_DATA {
18007 type Message = MavMessage;
18008 const ID: u32 = 107u32;
18009 const NAME: &'static str = "HIL_SENSOR";
18010 const EXTRA_CRC: u8 = 108u8;
18011 const ENCODED_LEN: usize = 65usize;
18012 fn deser(
18013 _version: MavlinkVersion,
18014 __input: &[u8],
18015 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18016 let avail_len = __input.len();
18017 let mut payload_buf = [0; Self::ENCODED_LEN];
18018 let mut buf = if avail_len < Self::ENCODED_LEN {
18019 payload_buf[0..avail_len].copy_from_slice(__input);
18020 Bytes::new(&payload_buf)
18021 } else {
18022 Bytes::new(__input)
18023 };
18024 let mut __struct = Self::default();
18025 __struct.time_usec = buf.get_u64_le()?;
18026 __struct.xacc = buf.get_f32_le()?;
18027 __struct.yacc = buf.get_f32_le()?;
18028 __struct.zacc = buf.get_f32_le()?;
18029 __struct.xgyro = buf.get_f32_le()?;
18030 __struct.ygyro = buf.get_f32_le()?;
18031 __struct.zgyro = buf.get_f32_le()?;
18032 __struct.xmag = buf.get_f32_le()?;
18033 __struct.ymag = buf.get_f32_le()?;
18034 __struct.zmag = buf.get_f32_le()?;
18035 __struct.abs_pressure = buf.get_f32_le()?;
18036 __struct.diff_pressure = buf.get_f32_le()?;
18037 __struct.pressure_alt = buf.get_f32_le()?;
18038 __struct.temperature = buf.get_f32_le()?;
18039 let tmp = buf.get_u32_le()?;
18040 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
18041 tmp as <HilSensorUpdatedFlags as Flags>::Bits,
18042 )
18043 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
18044 flag_type: "HilSensorUpdatedFlags",
18045 value: tmp as u64,
18046 })?;
18047 __struct.id = buf.get_u8()?;
18048 Ok(__struct)
18049 }
18050 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18051 let mut __tmp = BytesMut::new(bytes);
18052 #[allow(clippy::absurd_extreme_comparisons)]
18053 #[allow(unused_comparisons)]
18054 if __tmp.remaining() < Self::ENCODED_LEN {
18055 panic!(
18056 "buffer is too small (need {} bytes, but got {})",
18057 Self::ENCODED_LEN,
18058 __tmp.remaining(),
18059 )
18060 }
18061 __tmp.put_u64_le(self.time_usec);
18062 __tmp.put_f32_le(self.xacc);
18063 __tmp.put_f32_le(self.yacc);
18064 __tmp.put_f32_le(self.zacc);
18065 __tmp.put_f32_le(self.xgyro);
18066 __tmp.put_f32_le(self.ygyro);
18067 __tmp.put_f32_le(self.zgyro);
18068 __tmp.put_f32_le(self.xmag);
18069 __tmp.put_f32_le(self.ymag);
18070 __tmp.put_f32_le(self.zmag);
18071 __tmp.put_f32_le(self.abs_pressure);
18072 __tmp.put_f32_le(self.diff_pressure);
18073 __tmp.put_f32_le(self.pressure_alt);
18074 __tmp.put_f32_le(self.temperature);
18075 __tmp.put_u32_le(self.fields_updated.bits() as u32);
18076 if matches!(version, MavlinkVersion::V2) {
18077 __tmp.put_u8(self.id);
18078 let len = __tmp.len();
18079 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18080 } else {
18081 __tmp.len()
18082 }
18083 }
18084}
18085#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
18086#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
18087#[doc = ""]
18088#[doc = "ID: 90"]
18089#[derive(Debug, Clone, PartialEq)]
18090#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18091#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18092#[cfg_attr(feature = "ts", derive(TS))]
18093#[cfg_attr(feature = "ts", ts(export))]
18094pub struct HIL_STATE_DATA {
18095 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18096 pub time_usec: u64,
18097 #[doc = "Roll angle"]
18098 pub roll: f32,
18099 #[doc = "Pitch angle"]
18100 pub pitch: f32,
18101 #[doc = "Yaw angle"]
18102 pub yaw: f32,
18103 #[doc = "Body frame roll / phi angular speed"]
18104 pub rollspeed: f32,
18105 #[doc = "Body frame pitch / theta angular speed"]
18106 pub pitchspeed: f32,
18107 #[doc = "Body frame yaw / psi angular speed"]
18108 pub yawspeed: f32,
18109 #[doc = "Latitude"]
18110 pub lat: i32,
18111 #[doc = "Longitude"]
18112 pub lon: i32,
18113 #[doc = "Altitude"]
18114 pub alt: i32,
18115 #[doc = "Ground X Speed (Latitude)"]
18116 pub vx: i16,
18117 #[doc = "Ground Y Speed (Longitude)"]
18118 pub vy: i16,
18119 #[doc = "Ground Z Speed (Altitude)"]
18120 pub vz: i16,
18121 #[doc = "X acceleration"]
18122 pub xacc: i16,
18123 #[doc = "Y acceleration"]
18124 pub yacc: i16,
18125 #[doc = "Z acceleration"]
18126 pub zacc: i16,
18127}
18128impl HIL_STATE_DATA {
18129 pub const ENCODED_LEN: usize = 56usize;
18130 pub const DEFAULT: Self = Self {
18131 time_usec: 0_u64,
18132 roll: 0.0_f32,
18133 pitch: 0.0_f32,
18134 yaw: 0.0_f32,
18135 rollspeed: 0.0_f32,
18136 pitchspeed: 0.0_f32,
18137 yawspeed: 0.0_f32,
18138 lat: 0_i32,
18139 lon: 0_i32,
18140 alt: 0_i32,
18141 vx: 0_i16,
18142 vy: 0_i16,
18143 vz: 0_i16,
18144 xacc: 0_i16,
18145 yacc: 0_i16,
18146 zacc: 0_i16,
18147 };
18148 #[cfg(feature = "arbitrary")]
18149 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18150 use arbitrary::{Arbitrary, Unstructured};
18151 let mut buf = [0u8; 1024];
18152 rng.fill_bytes(&mut buf);
18153 let mut unstructured = Unstructured::new(&buf);
18154 Self::arbitrary(&mut unstructured).unwrap_or_default()
18155 }
18156}
18157impl Default for HIL_STATE_DATA {
18158 fn default() -> Self {
18159 Self::DEFAULT.clone()
18160 }
18161}
18162impl MessageData for HIL_STATE_DATA {
18163 type Message = MavMessage;
18164 const ID: u32 = 90u32;
18165 const NAME: &'static str = "HIL_STATE";
18166 const EXTRA_CRC: u8 = 183u8;
18167 const ENCODED_LEN: usize = 56usize;
18168 fn deser(
18169 _version: MavlinkVersion,
18170 __input: &[u8],
18171 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18172 let avail_len = __input.len();
18173 let mut payload_buf = [0; Self::ENCODED_LEN];
18174 let mut buf = if avail_len < Self::ENCODED_LEN {
18175 payload_buf[0..avail_len].copy_from_slice(__input);
18176 Bytes::new(&payload_buf)
18177 } else {
18178 Bytes::new(__input)
18179 };
18180 let mut __struct = Self::default();
18181 __struct.time_usec = buf.get_u64_le()?;
18182 __struct.roll = buf.get_f32_le()?;
18183 __struct.pitch = buf.get_f32_le()?;
18184 __struct.yaw = buf.get_f32_le()?;
18185 __struct.rollspeed = buf.get_f32_le()?;
18186 __struct.pitchspeed = buf.get_f32_le()?;
18187 __struct.yawspeed = buf.get_f32_le()?;
18188 __struct.lat = buf.get_i32_le()?;
18189 __struct.lon = buf.get_i32_le()?;
18190 __struct.alt = buf.get_i32_le()?;
18191 __struct.vx = buf.get_i16_le()?;
18192 __struct.vy = buf.get_i16_le()?;
18193 __struct.vz = buf.get_i16_le()?;
18194 __struct.xacc = buf.get_i16_le()?;
18195 __struct.yacc = buf.get_i16_le()?;
18196 __struct.zacc = buf.get_i16_le()?;
18197 Ok(__struct)
18198 }
18199 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18200 let mut __tmp = BytesMut::new(bytes);
18201 #[allow(clippy::absurd_extreme_comparisons)]
18202 #[allow(unused_comparisons)]
18203 if __tmp.remaining() < Self::ENCODED_LEN {
18204 panic!(
18205 "buffer is too small (need {} bytes, but got {})",
18206 Self::ENCODED_LEN,
18207 __tmp.remaining(),
18208 )
18209 }
18210 __tmp.put_u64_le(self.time_usec);
18211 __tmp.put_f32_le(self.roll);
18212 __tmp.put_f32_le(self.pitch);
18213 __tmp.put_f32_le(self.yaw);
18214 __tmp.put_f32_le(self.rollspeed);
18215 __tmp.put_f32_le(self.pitchspeed);
18216 __tmp.put_f32_le(self.yawspeed);
18217 __tmp.put_i32_le(self.lat);
18218 __tmp.put_i32_le(self.lon);
18219 __tmp.put_i32_le(self.alt);
18220 __tmp.put_i16_le(self.vx);
18221 __tmp.put_i16_le(self.vy);
18222 __tmp.put_i16_le(self.vz);
18223 __tmp.put_i16_le(self.xacc);
18224 __tmp.put_i16_le(self.yacc);
18225 __tmp.put_i16_le(self.zacc);
18226 if matches!(version, MavlinkVersion::V2) {
18227 let len = __tmp.len();
18228 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18229 } else {
18230 __tmp.len()
18231 }
18232 }
18233}
18234#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
18235#[doc = ""]
18236#[doc = "ID: 115"]
18237#[derive(Debug, Clone, PartialEq)]
18238#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18239#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18240#[cfg_attr(feature = "ts", derive(TS))]
18241#[cfg_attr(feature = "ts", ts(export))]
18242pub struct HIL_STATE_QUATERNION_DATA {
18243 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18244 pub time_usec: u64,
18245 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
18246 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18247 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18248 pub attitude_quaternion: [f32; 4],
18249 #[doc = "Body frame roll / phi angular speed"]
18250 pub rollspeed: f32,
18251 #[doc = "Body frame pitch / theta angular speed"]
18252 pub pitchspeed: f32,
18253 #[doc = "Body frame yaw / psi angular speed"]
18254 pub yawspeed: f32,
18255 #[doc = "Latitude"]
18256 pub lat: i32,
18257 #[doc = "Longitude"]
18258 pub lon: i32,
18259 #[doc = "Altitude"]
18260 pub alt: i32,
18261 #[doc = "Ground X Speed (Latitude)"]
18262 pub vx: i16,
18263 #[doc = "Ground Y Speed (Longitude)"]
18264 pub vy: i16,
18265 #[doc = "Ground Z Speed (Altitude)"]
18266 pub vz: i16,
18267 #[doc = "Indicated airspeed"]
18268 pub ind_airspeed: u16,
18269 #[doc = "True airspeed"]
18270 pub true_airspeed: u16,
18271 #[doc = "X acceleration"]
18272 pub xacc: i16,
18273 #[doc = "Y acceleration"]
18274 pub yacc: i16,
18275 #[doc = "Z acceleration"]
18276 pub zacc: i16,
18277}
18278impl HIL_STATE_QUATERNION_DATA {
18279 pub const ENCODED_LEN: usize = 64usize;
18280 pub const DEFAULT: Self = Self {
18281 time_usec: 0_u64,
18282 attitude_quaternion: [0.0_f32; 4usize],
18283 rollspeed: 0.0_f32,
18284 pitchspeed: 0.0_f32,
18285 yawspeed: 0.0_f32,
18286 lat: 0_i32,
18287 lon: 0_i32,
18288 alt: 0_i32,
18289 vx: 0_i16,
18290 vy: 0_i16,
18291 vz: 0_i16,
18292 ind_airspeed: 0_u16,
18293 true_airspeed: 0_u16,
18294 xacc: 0_i16,
18295 yacc: 0_i16,
18296 zacc: 0_i16,
18297 };
18298 #[cfg(feature = "arbitrary")]
18299 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18300 use arbitrary::{Arbitrary, Unstructured};
18301 let mut buf = [0u8; 1024];
18302 rng.fill_bytes(&mut buf);
18303 let mut unstructured = Unstructured::new(&buf);
18304 Self::arbitrary(&mut unstructured).unwrap_or_default()
18305 }
18306}
18307impl Default for HIL_STATE_QUATERNION_DATA {
18308 fn default() -> Self {
18309 Self::DEFAULT.clone()
18310 }
18311}
18312impl MessageData for HIL_STATE_QUATERNION_DATA {
18313 type Message = MavMessage;
18314 const ID: u32 = 115u32;
18315 const NAME: &'static str = "HIL_STATE_QUATERNION";
18316 const EXTRA_CRC: u8 = 4u8;
18317 const ENCODED_LEN: usize = 64usize;
18318 fn deser(
18319 _version: MavlinkVersion,
18320 __input: &[u8],
18321 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18322 let avail_len = __input.len();
18323 let mut payload_buf = [0; Self::ENCODED_LEN];
18324 let mut buf = if avail_len < Self::ENCODED_LEN {
18325 payload_buf[0..avail_len].copy_from_slice(__input);
18326 Bytes::new(&payload_buf)
18327 } else {
18328 Bytes::new(__input)
18329 };
18330 let mut __struct = Self::default();
18331 __struct.time_usec = buf.get_u64_le()?;
18332 for v in &mut __struct.attitude_quaternion {
18333 let val = buf.get_f32_le()?;
18334 *v = val;
18335 }
18336 __struct.rollspeed = buf.get_f32_le()?;
18337 __struct.pitchspeed = buf.get_f32_le()?;
18338 __struct.yawspeed = buf.get_f32_le()?;
18339 __struct.lat = buf.get_i32_le()?;
18340 __struct.lon = buf.get_i32_le()?;
18341 __struct.alt = buf.get_i32_le()?;
18342 __struct.vx = buf.get_i16_le()?;
18343 __struct.vy = buf.get_i16_le()?;
18344 __struct.vz = buf.get_i16_le()?;
18345 __struct.ind_airspeed = buf.get_u16_le()?;
18346 __struct.true_airspeed = buf.get_u16_le()?;
18347 __struct.xacc = buf.get_i16_le()?;
18348 __struct.yacc = buf.get_i16_le()?;
18349 __struct.zacc = buf.get_i16_le()?;
18350 Ok(__struct)
18351 }
18352 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18353 let mut __tmp = BytesMut::new(bytes);
18354 #[allow(clippy::absurd_extreme_comparisons)]
18355 #[allow(unused_comparisons)]
18356 if __tmp.remaining() < Self::ENCODED_LEN {
18357 panic!(
18358 "buffer is too small (need {} bytes, but got {})",
18359 Self::ENCODED_LEN,
18360 __tmp.remaining(),
18361 )
18362 }
18363 __tmp.put_u64_le(self.time_usec);
18364 for val in &self.attitude_quaternion {
18365 __tmp.put_f32_le(*val);
18366 }
18367 __tmp.put_f32_le(self.rollspeed);
18368 __tmp.put_f32_le(self.pitchspeed);
18369 __tmp.put_f32_le(self.yawspeed);
18370 __tmp.put_i32_le(self.lat);
18371 __tmp.put_i32_le(self.lon);
18372 __tmp.put_i32_le(self.alt);
18373 __tmp.put_i16_le(self.vx);
18374 __tmp.put_i16_le(self.vy);
18375 __tmp.put_i16_le(self.vz);
18376 __tmp.put_u16_le(self.ind_airspeed);
18377 __tmp.put_u16_le(self.true_airspeed);
18378 __tmp.put_i16_le(self.xacc);
18379 __tmp.put_i16_le(self.yacc);
18380 __tmp.put_i16_le(self.zacc);
18381 if matches!(version, MavlinkVersion::V2) {
18382 let len = __tmp.len();
18383 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18384 } else {
18385 __tmp.len()
18386 }
18387 }
18388}
18389#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
18390#[doc = ""]
18391#[doc = "ID: 242"]
18392#[derive(Debug, Clone, PartialEq)]
18393#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18394#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18395#[cfg_attr(feature = "ts", derive(TS))]
18396#[cfg_attr(feature = "ts", ts(export))]
18397pub struct HOME_POSITION_DATA {
18398 #[doc = "Latitude (WGS84)"]
18399 pub latitude: i32,
18400 #[doc = "Longitude (WGS84)"]
18401 pub longitude: i32,
18402 #[doc = "Altitude (MSL). Positive for up."]
18403 pub altitude: i32,
18404 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
18405 pub x: f32,
18406 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
18407 pub y: f32,
18408 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
18409 pub z: f32,
18410 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
18411 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18412 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18413 pub q: [f32; 4],
18414 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
18415 pub approach_x: f32,
18416 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
18417 pub approach_y: f32,
18418 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
18419 pub approach_z: f32,
18420 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18421 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18422 pub time_usec: u64,
18423}
18424impl HOME_POSITION_DATA {
18425 pub const ENCODED_LEN: usize = 60usize;
18426 pub const DEFAULT: Self = Self {
18427 latitude: 0_i32,
18428 longitude: 0_i32,
18429 altitude: 0_i32,
18430 x: 0.0_f32,
18431 y: 0.0_f32,
18432 z: 0.0_f32,
18433 q: [0.0_f32; 4usize],
18434 approach_x: 0.0_f32,
18435 approach_y: 0.0_f32,
18436 approach_z: 0.0_f32,
18437 time_usec: 0_u64,
18438 };
18439 #[cfg(feature = "arbitrary")]
18440 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18441 use arbitrary::{Arbitrary, Unstructured};
18442 let mut buf = [0u8; 1024];
18443 rng.fill_bytes(&mut buf);
18444 let mut unstructured = Unstructured::new(&buf);
18445 Self::arbitrary(&mut unstructured).unwrap_or_default()
18446 }
18447}
18448impl Default for HOME_POSITION_DATA {
18449 fn default() -> Self {
18450 Self::DEFAULT.clone()
18451 }
18452}
18453impl MessageData for HOME_POSITION_DATA {
18454 type Message = MavMessage;
18455 const ID: u32 = 242u32;
18456 const NAME: &'static str = "HOME_POSITION";
18457 const EXTRA_CRC: u8 = 104u8;
18458 const ENCODED_LEN: usize = 60usize;
18459 fn deser(
18460 _version: MavlinkVersion,
18461 __input: &[u8],
18462 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18463 let avail_len = __input.len();
18464 let mut payload_buf = [0; Self::ENCODED_LEN];
18465 let mut buf = if avail_len < Self::ENCODED_LEN {
18466 payload_buf[0..avail_len].copy_from_slice(__input);
18467 Bytes::new(&payload_buf)
18468 } else {
18469 Bytes::new(__input)
18470 };
18471 let mut __struct = Self::default();
18472 __struct.latitude = buf.get_i32_le()?;
18473 __struct.longitude = buf.get_i32_le()?;
18474 __struct.altitude = buf.get_i32_le()?;
18475 __struct.x = buf.get_f32_le()?;
18476 __struct.y = buf.get_f32_le()?;
18477 __struct.z = buf.get_f32_le()?;
18478 for v in &mut __struct.q {
18479 let val = buf.get_f32_le()?;
18480 *v = val;
18481 }
18482 __struct.approach_x = buf.get_f32_le()?;
18483 __struct.approach_y = buf.get_f32_le()?;
18484 __struct.approach_z = buf.get_f32_le()?;
18485 __struct.time_usec = buf.get_u64_le()?;
18486 Ok(__struct)
18487 }
18488 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18489 let mut __tmp = BytesMut::new(bytes);
18490 #[allow(clippy::absurd_extreme_comparisons)]
18491 #[allow(unused_comparisons)]
18492 if __tmp.remaining() < Self::ENCODED_LEN {
18493 panic!(
18494 "buffer is too small (need {} bytes, but got {})",
18495 Self::ENCODED_LEN,
18496 __tmp.remaining(),
18497 )
18498 }
18499 __tmp.put_i32_le(self.latitude);
18500 __tmp.put_i32_le(self.longitude);
18501 __tmp.put_i32_le(self.altitude);
18502 __tmp.put_f32_le(self.x);
18503 __tmp.put_f32_le(self.y);
18504 __tmp.put_f32_le(self.z);
18505 for val in &self.q {
18506 __tmp.put_f32_le(*val);
18507 }
18508 __tmp.put_f32_le(self.approach_x);
18509 __tmp.put_f32_le(self.approach_y);
18510 __tmp.put_f32_le(self.approach_z);
18511 if matches!(version, MavlinkVersion::V2) {
18512 __tmp.put_u64_le(self.time_usec);
18513 let len = __tmp.len();
18514 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18515 } else {
18516 __tmp.len()
18517 }
18518 }
18519}
18520#[doc = "Temperature and humidity from hygrometer."]
18521#[doc = ""]
18522#[doc = "ID: 12920"]
18523#[derive(Debug, Clone, PartialEq)]
18524#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18525#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18526#[cfg_attr(feature = "ts", derive(TS))]
18527#[cfg_attr(feature = "ts", ts(export))]
18528pub struct HYGROMETER_SENSOR_DATA {
18529 #[doc = "Temperature"]
18530 pub temperature: i16,
18531 #[doc = "Humidity"]
18532 pub humidity: u16,
18533 #[doc = "Hygrometer ID"]
18534 pub id: u8,
18535}
18536impl HYGROMETER_SENSOR_DATA {
18537 pub const ENCODED_LEN: usize = 5usize;
18538 pub const DEFAULT: Self = Self {
18539 temperature: 0_i16,
18540 humidity: 0_u16,
18541 id: 0_u8,
18542 };
18543 #[cfg(feature = "arbitrary")]
18544 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18545 use arbitrary::{Arbitrary, Unstructured};
18546 let mut buf = [0u8; 1024];
18547 rng.fill_bytes(&mut buf);
18548 let mut unstructured = Unstructured::new(&buf);
18549 Self::arbitrary(&mut unstructured).unwrap_or_default()
18550 }
18551}
18552impl Default for HYGROMETER_SENSOR_DATA {
18553 fn default() -> Self {
18554 Self::DEFAULT.clone()
18555 }
18556}
18557impl MessageData for HYGROMETER_SENSOR_DATA {
18558 type Message = MavMessage;
18559 const ID: u32 = 12920u32;
18560 const NAME: &'static str = "HYGROMETER_SENSOR";
18561 const EXTRA_CRC: u8 = 20u8;
18562 const ENCODED_LEN: usize = 5usize;
18563 fn deser(
18564 _version: MavlinkVersion,
18565 __input: &[u8],
18566 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18567 let avail_len = __input.len();
18568 let mut payload_buf = [0; Self::ENCODED_LEN];
18569 let mut buf = if avail_len < Self::ENCODED_LEN {
18570 payload_buf[0..avail_len].copy_from_slice(__input);
18571 Bytes::new(&payload_buf)
18572 } else {
18573 Bytes::new(__input)
18574 };
18575 let mut __struct = Self::default();
18576 __struct.temperature = buf.get_i16_le()?;
18577 __struct.humidity = buf.get_u16_le()?;
18578 __struct.id = buf.get_u8()?;
18579 Ok(__struct)
18580 }
18581 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18582 let mut __tmp = BytesMut::new(bytes);
18583 #[allow(clippy::absurd_extreme_comparisons)]
18584 #[allow(unused_comparisons)]
18585 if __tmp.remaining() < Self::ENCODED_LEN {
18586 panic!(
18587 "buffer is too small (need {} bytes, but got {})",
18588 Self::ENCODED_LEN,
18589 __tmp.remaining(),
18590 )
18591 }
18592 __tmp.put_i16_le(self.temperature);
18593 __tmp.put_u16_le(self.humidity);
18594 __tmp.put_u8(self.id);
18595 if matches!(version, MavlinkVersion::V2) {
18596 let len = __tmp.len();
18597 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18598 } else {
18599 __tmp.len()
18600 }
18601 }
18602}
18603#[doc = "Illuminator status."]
18604#[doc = ""]
18605#[doc = "ID: 440"]
18606#[derive(Debug, Clone, PartialEq)]
18607#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18608#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18609#[cfg_attr(feature = "ts", derive(TS))]
18610#[cfg_attr(feature = "ts", ts(export))]
18611pub struct ILLUMINATOR_STATUS_DATA {
18612 #[doc = "Time since the start-up of the illuminator in ms"]
18613 pub uptime_ms: u32,
18614 #[doc = "Errors"]
18615 pub error_status: IlluminatorErrorFlags,
18616 #[doc = "Illuminator brightness"]
18617 pub brightness: f32,
18618 #[doc = "Illuminator strobing period in seconds"]
18619 pub strobe_period: f32,
18620 #[doc = "Illuminator strobing duty cycle"]
18621 pub strobe_duty_cycle: f32,
18622 #[doc = "Temperature in Celsius"]
18623 pub temp_c: f32,
18624 #[doc = "Minimum strobing period in seconds"]
18625 pub min_strobe_period: f32,
18626 #[doc = "Maximum strobing period in seconds"]
18627 pub max_strobe_period: f32,
18628 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
18629 pub enable: u8,
18630 #[doc = "Supported illuminator modes"]
18631 pub mode_bitmask: IlluminatorMode,
18632 #[doc = "Illuminator mode"]
18633 pub mode: IlluminatorMode,
18634}
18635impl ILLUMINATOR_STATUS_DATA {
18636 pub const ENCODED_LEN: usize = 35usize;
18637 pub const DEFAULT: Self = Self {
18638 uptime_ms: 0_u32,
18639 error_status: IlluminatorErrorFlags::DEFAULT,
18640 brightness: 0.0_f32,
18641 strobe_period: 0.0_f32,
18642 strobe_duty_cycle: 0.0_f32,
18643 temp_c: 0.0_f32,
18644 min_strobe_period: 0.0_f32,
18645 max_strobe_period: 0.0_f32,
18646 enable: 0_u8,
18647 mode_bitmask: IlluminatorMode::DEFAULT,
18648 mode: IlluminatorMode::DEFAULT,
18649 };
18650 #[cfg(feature = "arbitrary")]
18651 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18652 use arbitrary::{Arbitrary, Unstructured};
18653 let mut buf = [0u8; 1024];
18654 rng.fill_bytes(&mut buf);
18655 let mut unstructured = Unstructured::new(&buf);
18656 Self::arbitrary(&mut unstructured).unwrap_or_default()
18657 }
18658}
18659impl Default for ILLUMINATOR_STATUS_DATA {
18660 fn default() -> Self {
18661 Self::DEFAULT.clone()
18662 }
18663}
18664impl MessageData for ILLUMINATOR_STATUS_DATA {
18665 type Message = MavMessage;
18666 const ID: u32 = 440u32;
18667 const NAME: &'static str = "ILLUMINATOR_STATUS";
18668 const EXTRA_CRC: u8 = 66u8;
18669 const ENCODED_LEN: usize = 35usize;
18670 fn deser(
18671 _version: MavlinkVersion,
18672 __input: &[u8],
18673 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18674 let avail_len = __input.len();
18675 let mut payload_buf = [0; Self::ENCODED_LEN];
18676 let mut buf = if avail_len < Self::ENCODED_LEN {
18677 payload_buf[0..avail_len].copy_from_slice(__input);
18678 Bytes::new(&payload_buf)
18679 } else {
18680 Bytes::new(__input)
18681 };
18682 let mut __struct = Self::default();
18683 __struct.uptime_ms = buf.get_u32_le()?;
18684 let tmp = buf.get_u32_le()?;
18685 __struct.error_status = IlluminatorErrorFlags::from_bits(
18686 tmp as <IlluminatorErrorFlags as Flags>::Bits,
18687 )
18688 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
18689 flag_type: "IlluminatorErrorFlags",
18690 value: tmp as u64,
18691 })?;
18692 __struct.brightness = buf.get_f32_le()?;
18693 __struct.strobe_period = buf.get_f32_le()?;
18694 __struct.strobe_duty_cycle = buf.get_f32_le()?;
18695 __struct.temp_c = buf.get_f32_le()?;
18696 __struct.min_strobe_period = buf.get_f32_le()?;
18697 __struct.max_strobe_period = buf.get_f32_le()?;
18698 __struct.enable = buf.get_u8()?;
18699 let tmp = buf.get_u8()?;
18700 __struct.mode_bitmask =
18701 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18702 enum_type: "IlluminatorMode",
18703 value: tmp as u64,
18704 })?;
18705 let tmp = buf.get_u8()?;
18706 __struct.mode =
18707 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18708 enum_type: "IlluminatorMode",
18709 value: tmp as u64,
18710 })?;
18711 Ok(__struct)
18712 }
18713 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18714 let mut __tmp = BytesMut::new(bytes);
18715 #[allow(clippy::absurd_extreme_comparisons)]
18716 #[allow(unused_comparisons)]
18717 if __tmp.remaining() < Self::ENCODED_LEN {
18718 panic!(
18719 "buffer is too small (need {} bytes, but got {})",
18720 Self::ENCODED_LEN,
18721 __tmp.remaining(),
18722 )
18723 }
18724 __tmp.put_u32_le(self.uptime_ms);
18725 __tmp.put_u32_le(self.error_status.bits() as u32);
18726 __tmp.put_f32_le(self.brightness);
18727 __tmp.put_f32_le(self.strobe_period);
18728 __tmp.put_f32_le(self.strobe_duty_cycle);
18729 __tmp.put_f32_le(self.temp_c);
18730 __tmp.put_f32_le(self.min_strobe_period);
18731 __tmp.put_f32_le(self.max_strobe_period);
18732 __tmp.put_u8(self.enable);
18733 __tmp.put_u8(self.mode_bitmask as u8);
18734 __tmp.put_u8(self.mode as u8);
18735 if matches!(version, MavlinkVersion::V2) {
18736 let len = __tmp.len();
18737 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18738 } else {
18739 __tmp.len()
18740 }
18741 }
18742}
18743#[doc = "Status of the Iridium SBD link."]
18744#[doc = ""]
18745#[doc = "ID: 335"]
18746#[derive(Debug, Clone, PartialEq)]
18747#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18748#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18749#[cfg_attr(feature = "ts", derive(TS))]
18750#[cfg_attr(feature = "ts", ts(export))]
18751pub struct ISBD_LINK_STATUS_DATA {
18752 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18753 pub timestamp: u64,
18754 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18755 pub last_heartbeat: u64,
18756 #[doc = "Number of failed SBD sessions."]
18757 pub failed_sessions: u16,
18758 #[doc = "Number of successful SBD sessions."]
18759 pub successful_sessions: u16,
18760 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
18761 pub signal_quality: u8,
18762 #[doc = "1: Ring call pending, 0: No call pending."]
18763 pub ring_pending: u8,
18764 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
18765 pub tx_session_pending: u8,
18766 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
18767 pub rx_session_pending: u8,
18768}
18769impl ISBD_LINK_STATUS_DATA {
18770 pub const ENCODED_LEN: usize = 24usize;
18771 pub const DEFAULT: Self = Self {
18772 timestamp: 0_u64,
18773 last_heartbeat: 0_u64,
18774 failed_sessions: 0_u16,
18775 successful_sessions: 0_u16,
18776 signal_quality: 0_u8,
18777 ring_pending: 0_u8,
18778 tx_session_pending: 0_u8,
18779 rx_session_pending: 0_u8,
18780 };
18781 #[cfg(feature = "arbitrary")]
18782 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18783 use arbitrary::{Arbitrary, Unstructured};
18784 let mut buf = [0u8; 1024];
18785 rng.fill_bytes(&mut buf);
18786 let mut unstructured = Unstructured::new(&buf);
18787 Self::arbitrary(&mut unstructured).unwrap_or_default()
18788 }
18789}
18790impl Default for ISBD_LINK_STATUS_DATA {
18791 fn default() -> Self {
18792 Self::DEFAULT.clone()
18793 }
18794}
18795impl MessageData for ISBD_LINK_STATUS_DATA {
18796 type Message = MavMessage;
18797 const ID: u32 = 335u32;
18798 const NAME: &'static str = "ISBD_LINK_STATUS";
18799 const EXTRA_CRC: u8 = 225u8;
18800 const ENCODED_LEN: usize = 24usize;
18801 fn deser(
18802 _version: MavlinkVersion,
18803 __input: &[u8],
18804 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18805 let avail_len = __input.len();
18806 let mut payload_buf = [0; Self::ENCODED_LEN];
18807 let mut buf = if avail_len < Self::ENCODED_LEN {
18808 payload_buf[0..avail_len].copy_from_slice(__input);
18809 Bytes::new(&payload_buf)
18810 } else {
18811 Bytes::new(__input)
18812 };
18813 let mut __struct = Self::default();
18814 __struct.timestamp = buf.get_u64_le()?;
18815 __struct.last_heartbeat = buf.get_u64_le()?;
18816 __struct.failed_sessions = buf.get_u16_le()?;
18817 __struct.successful_sessions = buf.get_u16_le()?;
18818 __struct.signal_quality = buf.get_u8()?;
18819 __struct.ring_pending = buf.get_u8()?;
18820 __struct.tx_session_pending = buf.get_u8()?;
18821 __struct.rx_session_pending = buf.get_u8()?;
18822 Ok(__struct)
18823 }
18824 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18825 let mut __tmp = BytesMut::new(bytes);
18826 #[allow(clippy::absurd_extreme_comparisons)]
18827 #[allow(unused_comparisons)]
18828 if __tmp.remaining() < Self::ENCODED_LEN {
18829 panic!(
18830 "buffer is too small (need {} bytes, but got {})",
18831 Self::ENCODED_LEN,
18832 __tmp.remaining(),
18833 )
18834 }
18835 __tmp.put_u64_le(self.timestamp);
18836 __tmp.put_u64_le(self.last_heartbeat);
18837 __tmp.put_u16_le(self.failed_sessions);
18838 __tmp.put_u16_le(self.successful_sessions);
18839 __tmp.put_u8(self.signal_quality);
18840 __tmp.put_u8(self.ring_pending);
18841 __tmp.put_u8(self.tx_session_pending);
18842 __tmp.put_u8(self.rx_session_pending);
18843 if matches!(version, MavlinkVersion::V2) {
18844 let len = __tmp.len();
18845 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18846 } else {
18847 __tmp.len()
18848 }
18849 }
18850}
18851#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
18852#[doc = ""]
18853#[doc = "ID: 149"]
18854#[derive(Debug, Clone, PartialEq)]
18855#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18856#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18857#[cfg_attr(feature = "ts", derive(TS))]
18858#[cfg_attr(feature = "ts", ts(export))]
18859pub struct LANDING_TARGET_DATA {
18860 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18861 pub time_usec: u64,
18862 #[doc = "X-axis angular offset of the target from the center of the image"]
18863 pub angle_x: f32,
18864 #[doc = "Y-axis angular offset of the target from the center of the image"]
18865 pub angle_y: f32,
18866 #[doc = "Distance to the target from the vehicle"]
18867 pub distance: f32,
18868 #[doc = "Size of target along x-axis"]
18869 pub size_x: f32,
18870 #[doc = "Size of target along y-axis"]
18871 pub size_y: f32,
18872 #[doc = "The ID of the target if multiple targets are present"]
18873 pub target_num: u8,
18874 #[doc = "Coordinate frame used for following fields."]
18875 pub frame: MavFrame,
18876 #[doc = "X Position of the landing target in MAV_FRAME"]
18877 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18878 pub x: f32,
18879 #[doc = "Y Position of the landing target in MAV_FRAME"]
18880 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18881 pub y: f32,
18882 #[doc = "Z Position of the landing target in MAV_FRAME"]
18883 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18884 pub z: f32,
18885 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
18886 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18887 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18888 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18889 pub q: [f32; 4],
18890 #[doc = "Type of landing target"]
18891 #[cfg_attr(feature = "serde", serde(default))]
18892 pub mavtype: LandingTargetType,
18893 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
18894 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18895 pub position_valid: u8,
18896}
18897impl LANDING_TARGET_DATA {
18898 pub const ENCODED_LEN: usize = 60usize;
18899 pub const DEFAULT: Self = Self {
18900 time_usec: 0_u64,
18901 angle_x: 0.0_f32,
18902 angle_y: 0.0_f32,
18903 distance: 0.0_f32,
18904 size_x: 0.0_f32,
18905 size_y: 0.0_f32,
18906 target_num: 0_u8,
18907 frame: MavFrame::DEFAULT,
18908 x: 0.0_f32,
18909 y: 0.0_f32,
18910 z: 0.0_f32,
18911 q: [0.0_f32; 4usize],
18912 mavtype: LandingTargetType::DEFAULT,
18913 position_valid: 0_u8,
18914 };
18915 #[cfg(feature = "arbitrary")]
18916 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18917 use arbitrary::{Arbitrary, Unstructured};
18918 let mut buf = [0u8; 1024];
18919 rng.fill_bytes(&mut buf);
18920 let mut unstructured = Unstructured::new(&buf);
18921 Self::arbitrary(&mut unstructured).unwrap_or_default()
18922 }
18923}
18924impl Default for LANDING_TARGET_DATA {
18925 fn default() -> Self {
18926 Self::DEFAULT.clone()
18927 }
18928}
18929impl MessageData for LANDING_TARGET_DATA {
18930 type Message = MavMessage;
18931 const ID: u32 = 149u32;
18932 const NAME: &'static str = "LANDING_TARGET";
18933 const EXTRA_CRC: u8 = 200u8;
18934 const ENCODED_LEN: usize = 60usize;
18935 fn deser(
18936 _version: MavlinkVersion,
18937 __input: &[u8],
18938 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18939 let avail_len = __input.len();
18940 let mut payload_buf = [0; Self::ENCODED_LEN];
18941 let mut buf = if avail_len < Self::ENCODED_LEN {
18942 payload_buf[0..avail_len].copy_from_slice(__input);
18943 Bytes::new(&payload_buf)
18944 } else {
18945 Bytes::new(__input)
18946 };
18947 let mut __struct = Self::default();
18948 __struct.time_usec = buf.get_u64_le()?;
18949 __struct.angle_x = buf.get_f32_le()?;
18950 __struct.angle_y = buf.get_f32_le()?;
18951 __struct.distance = buf.get_f32_le()?;
18952 __struct.size_x = buf.get_f32_le()?;
18953 __struct.size_y = buf.get_f32_le()?;
18954 __struct.target_num = buf.get_u8()?;
18955 let tmp = buf.get_u8()?;
18956 __struct.frame =
18957 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18958 enum_type: "MavFrame",
18959 value: tmp as u64,
18960 })?;
18961 __struct.x = buf.get_f32_le()?;
18962 __struct.y = buf.get_f32_le()?;
18963 __struct.z = buf.get_f32_le()?;
18964 for v in &mut __struct.q {
18965 let val = buf.get_f32_le()?;
18966 *v = val;
18967 }
18968 let tmp = buf.get_u8()?;
18969 __struct.mavtype =
18970 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18971 enum_type: "LandingTargetType",
18972 value: tmp as u64,
18973 })?;
18974 __struct.position_valid = buf.get_u8()?;
18975 Ok(__struct)
18976 }
18977 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18978 let mut __tmp = BytesMut::new(bytes);
18979 #[allow(clippy::absurd_extreme_comparisons)]
18980 #[allow(unused_comparisons)]
18981 if __tmp.remaining() < Self::ENCODED_LEN {
18982 panic!(
18983 "buffer is too small (need {} bytes, but got {})",
18984 Self::ENCODED_LEN,
18985 __tmp.remaining(),
18986 )
18987 }
18988 __tmp.put_u64_le(self.time_usec);
18989 __tmp.put_f32_le(self.angle_x);
18990 __tmp.put_f32_le(self.angle_y);
18991 __tmp.put_f32_le(self.distance);
18992 __tmp.put_f32_le(self.size_x);
18993 __tmp.put_f32_le(self.size_y);
18994 __tmp.put_u8(self.target_num);
18995 __tmp.put_u8(self.frame as u8);
18996 if matches!(version, MavlinkVersion::V2) {
18997 __tmp.put_f32_le(self.x);
18998 __tmp.put_f32_le(self.y);
18999 __tmp.put_f32_le(self.z);
19000 for val in &self.q {
19001 __tmp.put_f32_le(*val);
19002 }
19003 __tmp.put_u8(self.mavtype as u8);
19004 __tmp.put_u8(self.position_valid);
19005 let len = __tmp.len();
19006 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19007 } else {
19008 __tmp.len()
19009 }
19010 }
19011}
19012#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
19013#[doc = ""]
19014#[doc = "ID: 8"]
19015#[derive(Debug, Clone, PartialEq)]
19016#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19017#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19018#[cfg_attr(feature = "ts", derive(TS))]
19019#[cfg_attr(feature = "ts", ts(export))]
19020pub struct LINK_NODE_STATUS_DATA {
19021 #[doc = "Timestamp (time since system boot)."]
19022 pub timestamp: u64,
19023 #[doc = "Transmit rate"]
19024 pub tx_rate: u32,
19025 #[doc = "Receive rate"]
19026 pub rx_rate: u32,
19027 #[doc = "Messages sent"]
19028 pub messages_sent: u32,
19029 #[doc = "Messages received (estimated from counting seq)"]
19030 pub messages_received: u32,
19031 #[doc = "Messages lost (estimated from counting seq)"]
19032 pub messages_lost: u32,
19033 #[doc = "Number of bytes that could not be parsed correctly."]
19034 pub rx_parse_err: u16,
19035 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
19036 pub tx_overflows: u16,
19037 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
19038 pub rx_overflows: u16,
19039 #[doc = "Remaining free transmit buffer space"]
19040 pub tx_buf: u8,
19041 #[doc = "Remaining free receive buffer space"]
19042 pub rx_buf: u8,
19043}
19044impl LINK_NODE_STATUS_DATA {
19045 pub const ENCODED_LEN: usize = 36usize;
19046 pub const DEFAULT: Self = Self {
19047 timestamp: 0_u64,
19048 tx_rate: 0_u32,
19049 rx_rate: 0_u32,
19050 messages_sent: 0_u32,
19051 messages_received: 0_u32,
19052 messages_lost: 0_u32,
19053 rx_parse_err: 0_u16,
19054 tx_overflows: 0_u16,
19055 rx_overflows: 0_u16,
19056 tx_buf: 0_u8,
19057 rx_buf: 0_u8,
19058 };
19059 #[cfg(feature = "arbitrary")]
19060 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19061 use arbitrary::{Arbitrary, Unstructured};
19062 let mut buf = [0u8; 1024];
19063 rng.fill_bytes(&mut buf);
19064 let mut unstructured = Unstructured::new(&buf);
19065 Self::arbitrary(&mut unstructured).unwrap_or_default()
19066 }
19067}
19068impl Default for LINK_NODE_STATUS_DATA {
19069 fn default() -> Self {
19070 Self::DEFAULT.clone()
19071 }
19072}
19073impl MessageData for LINK_NODE_STATUS_DATA {
19074 type Message = MavMessage;
19075 const ID: u32 = 8u32;
19076 const NAME: &'static str = "LINK_NODE_STATUS";
19077 const EXTRA_CRC: u8 = 117u8;
19078 const ENCODED_LEN: usize = 36usize;
19079 fn deser(
19080 _version: MavlinkVersion,
19081 __input: &[u8],
19082 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19083 let avail_len = __input.len();
19084 let mut payload_buf = [0; Self::ENCODED_LEN];
19085 let mut buf = if avail_len < Self::ENCODED_LEN {
19086 payload_buf[0..avail_len].copy_from_slice(__input);
19087 Bytes::new(&payload_buf)
19088 } else {
19089 Bytes::new(__input)
19090 };
19091 let mut __struct = Self::default();
19092 __struct.timestamp = buf.get_u64_le()?;
19093 __struct.tx_rate = buf.get_u32_le()?;
19094 __struct.rx_rate = buf.get_u32_le()?;
19095 __struct.messages_sent = buf.get_u32_le()?;
19096 __struct.messages_received = buf.get_u32_le()?;
19097 __struct.messages_lost = buf.get_u32_le()?;
19098 __struct.rx_parse_err = buf.get_u16_le()?;
19099 __struct.tx_overflows = buf.get_u16_le()?;
19100 __struct.rx_overflows = buf.get_u16_le()?;
19101 __struct.tx_buf = buf.get_u8()?;
19102 __struct.rx_buf = buf.get_u8()?;
19103 Ok(__struct)
19104 }
19105 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19106 let mut __tmp = BytesMut::new(bytes);
19107 #[allow(clippy::absurd_extreme_comparisons)]
19108 #[allow(unused_comparisons)]
19109 if __tmp.remaining() < Self::ENCODED_LEN {
19110 panic!(
19111 "buffer is too small (need {} bytes, but got {})",
19112 Self::ENCODED_LEN,
19113 __tmp.remaining(),
19114 )
19115 }
19116 __tmp.put_u64_le(self.timestamp);
19117 __tmp.put_u32_le(self.tx_rate);
19118 __tmp.put_u32_le(self.rx_rate);
19119 __tmp.put_u32_le(self.messages_sent);
19120 __tmp.put_u32_le(self.messages_received);
19121 __tmp.put_u32_le(self.messages_lost);
19122 __tmp.put_u16_le(self.rx_parse_err);
19123 __tmp.put_u16_le(self.tx_overflows);
19124 __tmp.put_u16_le(self.rx_overflows);
19125 __tmp.put_u8(self.tx_buf);
19126 __tmp.put_u8(self.rx_buf);
19127 if matches!(version, MavlinkVersion::V2) {
19128 let len = __tmp.len();
19129 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19130 } else {
19131 __tmp.len()
19132 }
19133 }
19134}
19135#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
19136#[doc = ""]
19137#[doc = "ID: 32"]
19138#[derive(Debug, Clone, PartialEq)]
19139#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19140#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19141#[cfg_attr(feature = "ts", derive(TS))]
19142#[cfg_attr(feature = "ts", ts(export))]
19143pub struct LOCAL_POSITION_NED_DATA {
19144 #[doc = "Timestamp (time since system boot)."]
19145 pub time_boot_ms: u32,
19146 #[doc = "X Position"]
19147 pub x: f32,
19148 #[doc = "Y Position"]
19149 pub y: f32,
19150 #[doc = "Z Position"]
19151 pub z: f32,
19152 #[doc = "X Speed"]
19153 pub vx: f32,
19154 #[doc = "Y Speed"]
19155 pub vy: f32,
19156 #[doc = "Z Speed"]
19157 pub vz: f32,
19158}
19159impl LOCAL_POSITION_NED_DATA {
19160 pub const ENCODED_LEN: usize = 28usize;
19161 pub const DEFAULT: Self = Self {
19162 time_boot_ms: 0_u32,
19163 x: 0.0_f32,
19164 y: 0.0_f32,
19165 z: 0.0_f32,
19166 vx: 0.0_f32,
19167 vy: 0.0_f32,
19168 vz: 0.0_f32,
19169 };
19170 #[cfg(feature = "arbitrary")]
19171 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19172 use arbitrary::{Arbitrary, Unstructured};
19173 let mut buf = [0u8; 1024];
19174 rng.fill_bytes(&mut buf);
19175 let mut unstructured = Unstructured::new(&buf);
19176 Self::arbitrary(&mut unstructured).unwrap_or_default()
19177 }
19178}
19179impl Default for LOCAL_POSITION_NED_DATA {
19180 fn default() -> Self {
19181 Self::DEFAULT.clone()
19182 }
19183}
19184impl MessageData for LOCAL_POSITION_NED_DATA {
19185 type Message = MavMessage;
19186 const ID: u32 = 32u32;
19187 const NAME: &'static str = "LOCAL_POSITION_NED";
19188 const EXTRA_CRC: u8 = 185u8;
19189 const ENCODED_LEN: usize = 28usize;
19190 fn deser(
19191 _version: MavlinkVersion,
19192 __input: &[u8],
19193 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19194 let avail_len = __input.len();
19195 let mut payload_buf = [0; Self::ENCODED_LEN];
19196 let mut buf = if avail_len < Self::ENCODED_LEN {
19197 payload_buf[0..avail_len].copy_from_slice(__input);
19198 Bytes::new(&payload_buf)
19199 } else {
19200 Bytes::new(__input)
19201 };
19202 let mut __struct = Self::default();
19203 __struct.time_boot_ms = buf.get_u32_le()?;
19204 __struct.x = buf.get_f32_le()?;
19205 __struct.y = buf.get_f32_le()?;
19206 __struct.z = buf.get_f32_le()?;
19207 __struct.vx = buf.get_f32_le()?;
19208 __struct.vy = buf.get_f32_le()?;
19209 __struct.vz = buf.get_f32_le()?;
19210 Ok(__struct)
19211 }
19212 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19213 let mut __tmp = BytesMut::new(bytes);
19214 #[allow(clippy::absurd_extreme_comparisons)]
19215 #[allow(unused_comparisons)]
19216 if __tmp.remaining() < Self::ENCODED_LEN {
19217 panic!(
19218 "buffer is too small (need {} bytes, but got {})",
19219 Self::ENCODED_LEN,
19220 __tmp.remaining(),
19221 )
19222 }
19223 __tmp.put_u32_le(self.time_boot_ms);
19224 __tmp.put_f32_le(self.x);
19225 __tmp.put_f32_le(self.y);
19226 __tmp.put_f32_le(self.z);
19227 __tmp.put_f32_le(self.vx);
19228 __tmp.put_f32_le(self.vy);
19229 __tmp.put_f32_le(self.vz);
19230 if matches!(version, MavlinkVersion::V2) {
19231 let len = __tmp.len();
19232 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19233 } else {
19234 __tmp.len()
19235 }
19236 }
19237}
19238#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
19239#[doc = ""]
19240#[doc = "ID: 64"]
19241#[derive(Debug, Clone, PartialEq)]
19242#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19244#[cfg_attr(feature = "ts", derive(TS))]
19245#[cfg_attr(feature = "ts", ts(export))]
19246pub struct LOCAL_POSITION_NED_COV_DATA {
19247 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
19248 pub time_usec: u64,
19249 #[doc = "X Position"]
19250 pub x: f32,
19251 #[doc = "Y Position"]
19252 pub y: f32,
19253 #[doc = "Z Position"]
19254 pub z: f32,
19255 #[doc = "X Speed"]
19256 pub vx: f32,
19257 #[doc = "Y Speed"]
19258 pub vy: f32,
19259 #[doc = "Z Speed"]
19260 pub vz: f32,
19261 #[doc = "X Acceleration"]
19262 pub ax: f32,
19263 #[doc = "Y Acceleration"]
19264 pub ay: f32,
19265 #[doc = "Z Acceleration"]
19266 pub az: f32,
19267 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
19268 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19269 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19270 pub covariance: [f32; 45],
19271 #[doc = "Class id of the estimator this estimate originated from."]
19272 pub estimator_type: MavEstimatorType,
19273}
19274impl LOCAL_POSITION_NED_COV_DATA {
19275 pub const ENCODED_LEN: usize = 225usize;
19276 pub const DEFAULT: Self = Self {
19277 time_usec: 0_u64,
19278 x: 0.0_f32,
19279 y: 0.0_f32,
19280 z: 0.0_f32,
19281 vx: 0.0_f32,
19282 vy: 0.0_f32,
19283 vz: 0.0_f32,
19284 ax: 0.0_f32,
19285 ay: 0.0_f32,
19286 az: 0.0_f32,
19287 covariance: [0.0_f32; 45usize],
19288 estimator_type: MavEstimatorType::DEFAULT,
19289 };
19290 #[cfg(feature = "arbitrary")]
19291 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19292 use arbitrary::{Arbitrary, Unstructured};
19293 let mut buf = [0u8; 1024];
19294 rng.fill_bytes(&mut buf);
19295 let mut unstructured = Unstructured::new(&buf);
19296 Self::arbitrary(&mut unstructured).unwrap_or_default()
19297 }
19298}
19299impl Default for LOCAL_POSITION_NED_COV_DATA {
19300 fn default() -> Self {
19301 Self::DEFAULT.clone()
19302 }
19303}
19304impl MessageData for LOCAL_POSITION_NED_COV_DATA {
19305 type Message = MavMessage;
19306 const ID: u32 = 64u32;
19307 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
19308 const EXTRA_CRC: u8 = 191u8;
19309 const ENCODED_LEN: usize = 225usize;
19310 fn deser(
19311 _version: MavlinkVersion,
19312 __input: &[u8],
19313 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19314 let avail_len = __input.len();
19315 let mut payload_buf = [0; Self::ENCODED_LEN];
19316 let mut buf = if avail_len < Self::ENCODED_LEN {
19317 payload_buf[0..avail_len].copy_from_slice(__input);
19318 Bytes::new(&payload_buf)
19319 } else {
19320 Bytes::new(__input)
19321 };
19322 let mut __struct = Self::default();
19323 __struct.time_usec = buf.get_u64_le()?;
19324 __struct.x = buf.get_f32_le()?;
19325 __struct.y = buf.get_f32_le()?;
19326 __struct.z = buf.get_f32_le()?;
19327 __struct.vx = buf.get_f32_le()?;
19328 __struct.vy = buf.get_f32_le()?;
19329 __struct.vz = buf.get_f32_le()?;
19330 __struct.ax = buf.get_f32_le()?;
19331 __struct.ay = buf.get_f32_le()?;
19332 __struct.az = buf.get_f32_le()?;
19333 for v in &mut __struct.covariance {
19334 let val = buf.get_f32_le()?;
19335 *v = val;
19336 }
19337 let tmp = buf.get_u8()?;
19338 __struct.estimator_type =
19339 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19340 enum_type: "MavEstimatorType",
19341 value: tmp as u64,
19342 })?;
19343 Ok(__struct)
19344 }
19345 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19346 let mut __tmp = BytesMut::new(bytes);
19347 #[allow(clippy::absurd_extreme_comparisons)]
19348 #[allow(unused_comparisons)]
19349 if __tmp.remaining() < Self::ENCODED_LEN {
19350 panic!(
19351 "buffer is too small (need {} bytes, but got {})",
19352 Self::ENCODED_LEN,
19353 __tmp.remaining(),
19354 )
19355 }
19356 __tmp.put_u64_le(self.time_usec);
19357 __tmp.put_f32_le(self.x);
19358 __tmp.put_f32_le(self.y);
19359 __tmp.put_f32_le(self.z);
19360 __tmp.put_f32_le(self.vx);
19361 __tmp.put_f32_le(self.vy);
19362 __tmp.put_f32_le(self.vz);
19363 __tmp.put_f32_le(self.ax);
19364 __tmp.put_f32_le(self.ay);
19365 __tmp.put_f32_le(self.az);
19366 for val in &self.covariance {
19367 __tmp.put_f32_le(*val);
19368 }
19369 __tmp.put_u8(self.estimator_type as u8);
19370 if matches!(version, MavlinkVersion::V2) {
19371 let len = __tmp.len();
19372 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19373 } else {
19374 __tmp.len()
19375 }
19376 }
19377}
19378#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
19379#[doc = ""]
19380#[doc = "ID: 89"]
19381#[derive(Debug, Clone, PartialEq)]
19382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19383#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19384#[cfg_attr(feature = "ts", derive(TS))]
19385#[cfg_attr(feature = "ts", ts(export))]
19386pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
19387 #[doc = "Timestamp (time since system boot)."]
19388 pub time_boot_ms: u32,
19389 #[doc = "X Position"]
19390 pub x: f32,
19391 #[doc = "Y Position"]
19392 pub y: f32,
19393 #[doc = "Z Position"]
19394 pub z: f32,
19395 #[doc = "Roll"]
19396 pub roll: f32,
19397 #[doc = "Pitch"]
19398 pub pitch: f32,
19399 #[doc = "Yaw"]
19400 pub yaw: f32,
19401}
19402impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
19403 pub const ENCODED_LEN: usize = 28usize;
19404 pub const DEFAULT: Self = Self {
19405 time_boot_ms: 0_u32,
19406 x: 0.0_f32,
19407 y: 0.0_f32,
19408 z: 0.0_f32,
19409 roll: 0.0_f32,
19410 pitch: 0.0_f32,
19411 yaw: 0.0_f32,
19412 };
19413 #[cfg(feature = "arbitrary")]
19414 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19415 use arbitrary::{Arbitrary, Unstructured};
19416 let mut buf = [0u8; 1024];
19417 rng.fill_bytes(&mut buf);
19418 let mut unstructured = Unstructured::new(&buf);
19419 Self::arbitrary(&mut unstructured).unwrap_or_default()
19420 }
19421}
19422impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
19423 fn default() -> Self {
19424 Self::DEFAULT.clone()
19425 }
19426}
19427impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
19428 type Message = MavMessage;
19429 const ID: u32 = 89u32;
19430 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
19431 const EXTRA_CRC: u8 = 231u8;
19432 const ENCODED_LEN: usize = 28usize;
19433 fn deser(
19434 _version: MavlinkVersion,
19435 __input: &[u8],
19436 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19437 let avail_len = __input.len();
19438 let mut payload_buf = [0; Self::ENCODED_LEN];
19439 let mut buf = if avail_len < Self::ENCODED_LEN {
19440 payload_buf[0..avail_len].copy_from_slice(__input);
19441 Bytes::new(&payload_buf)
19442 } else {
19443 Bytes::new(__input)
19444 };
19445 let mut __struct = Self::default();
19446 __struct.time_boot_ms = buf.get_u32_le()?;
19447 __struct.x = buf.get_f32_le()?;
19448 __struct.y = buf.get_f32_le()?;
19449 __struct.z = buf.get_f32_le()?;
19450 __struct.roll = buf.get_f32_le()?;
19451 __struct.pitch = buf.get_f32_le()?;
19452 __struct.yaw = buf.get_f32_le()?;
19453 Ok(__struct)
19454 }
19455 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19456 let mut __tmp = BytesMut::new(bytes);
19457 #[allow(clippy::absurd_extreme_comparisons)]
19458 #[allow(unused_comparisons)]
19459 if __tmp.remaining() < Self::ENCODED_LEN {
19460 panic!(
19461 "buffer is too small (need {} bytes, but got {})",
19462 Self::ENCODED_LEN,
19463 __tmp.remaining(),
19464 )
19465 }
19466 __tmp.put_u32_le(self.time_boot_ms);
19467 __tmp.put_f32_le(self.x);
19468 __tmp.put_f32_le(self.y);
19469 __tmp.put_f32_le(self.z);
19470 __tmp.put_f32_le(self.roll);
19471 __tmp.put_f32_le(self.pitch);
19472 __tmp.put_f32_le(self.yaw);
19473 if matches!(version, MavlinkVersion::V2) {
19474 let len = __tmp.len();
19475 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19476 } else {
19477 __tmp.len()
19478 }
19479 }
19480}
19481#[doc = "An ack for a LOGGING_DATA_ACKED message."]
19482#[doc = ""]
19483#[doc = "ID: 268"]
19484#[derive(Debug, Clone, PartialEq)]
19485#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19486#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19487#[cfg_attr(feature = "ts", derive(TS))]
19488#[cfg_attr(feature = "ts", ts(export))]
19489pub struct LOGGING_ACK_DATA {
19490 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
19491 pub sequence: u16,
19492 #[doc = "system ID of the target"]
19493 pub target_system: u8,
19494 #[doc = "component ID of the target"]
19495 pub target_component: u8,
19496}
19497impl LOGGING_ACK_DATA {
19498 pub const ENCODED_LEN: usize = 4usize;
19499 pub const DEFAULT: Self = Self {
19500 sequence: 0_u16,
19501 target_system: 0_u8,
19502 target_component: 0_u8,
19503 };
19504 #[cfg(feature = "arbitrary")]
19505 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19506 use arbitrary::{Arbitrary, Unstructured};
19507 let mut buf = [0u8; 1024];
19508 rng.fill_bytes(&mut buf);
19509 let mut unstructured = Unstructured::new(&buf);
19510 Self::arbitrary(&mut unstructured).unwrap_or_default()
19511 }
19512}
19513impl Default for LOGGING_ACK_DATA {
19514 fn default() -> Self {
19515 Self::DEFAULT.clone()
19516 }
19517}
19518impl MessageData for LOGGING_ACK_DATA {
19519 type Message = MavMessage;
19520 const ID: u32 = 268u32;
19521 const NAME: &'static str = "LOGGING_ACK";
19522 const EXTRA_CRC: u8 = 14u8;
19523 const ENCODED_LEN: usize = 4usize;
19524 fn deser(
19525 _version: MavlinkVersion,
19526 __input: &[u8],
19527 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19528 let avail_len = __input.len();
19529 let mut payload_buf = [0; Self::ENCODED_LEN];
19530 let mut buf = if avail_len < Self::ENCODED_LEN {
19531 payload_buf[0..avail_len].copy_from_slice(__input);
19532 Bytes::new(&payload_buf)
19533 } else {
19534 Bytes::new(__input)
19535 };
19536 let mut __struct = Self::default();
19537 __struct.sequence = buf.get_u16_le()?;
19538 __struct.target_system = buf.get_u8()?;
19539 __struct.target_component = buf.get_u8()?;
19540 Ok(__struct)
19541 }
19542 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19543 let mut __tmp = BytesMut::new(bytes);
19544 #[allow(clippy::absurd_extreme_comparisons)]
19545 #[allow(unused_comparisons)]
19546 if __tmp.remaining() < Self::ENCODED_LEN {
19547 panic!(
19548 "buffer is too small (need {} bytes, but got {})",
19549 Self::ENCODED_LEN,
19550 __tmp.remaining(),
19551 )
19552 }
19553 __tmp.put_u16_le(self.sequence);
19554 __tmp.put_u8(self.target_system);
19555 __tmp.put_u8(self.target_component);
19556 if matches!(version, MavlinkVersion::V2) {
19557 let len = __tmp.len();
19558 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19559 } else {
19560 __tmp.len()
19561 }
19562 }
19563}
19564#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
19565#[doc = ""]
19566#[doc = "ID: 266"]
19567#[derive(Debug, Clone, PartialEq)]
19568#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19569#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19570#[cfg_attr(feature = "ts", derive(TS))]
19571#[cfg_attr(feature = "ts", ts(export))]
19572pub struct LOGGING_DATA_DATA {
19573 #[doc = "sequence number (can wrap)"]
19574 pub sequence: u16,
19575 #[doc = "system ID of the target"]
19576 pub target_system: u8,
19577 #[doc = "component ID of the target"]
19578 pub target_component: u8,
19579 #[doc = "data length"]
19580 pub length: u8,
19581 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
19582 pub first_message_offset: u8,
19583 #[doc = "logged data"]
19584 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19585 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19586 pub data: [u8; 249],
19587}
19588impl LOGGING_DATA_DATA {
19589 pub const ENCODED_LEN: usize = 255usize;
19590 pub const DEFAULT: Self = Self {
19591 sequence: 0_u16,
19592 target_system: 0_u8,
19593 target_component: 0_u8,
19594 length: 0_u8,
19595 first_message_offset: 0_u8,
19596 data: [0_u8; 249usize],
19597 };
19598 #[cfg(feature = "arbitrary")]
19599 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19600 use arbitrary::{Arbitrary, Unstructured};
19601 let mut buf = [0u8; 1024];
19602 rng.fill_bytes(&mut buf);
19603 let mut unstructured = Unstructured::new(&buf);
19604 Self::arbitrary(&mut unstructured).unwrap_or_default()
19605 }
19606}
19607impl Default for LOGGING_DATA_DATA {
19608 fn default() -> Self {
19609 Self::DEFAULT.clone()
19610 }
19611}
19612impl MessageData for LOGGING_DATA_DATA {
19613 type Message = MavMessage;
19614 const ID: u32 = 266u32;
19615 const NAME: &'static str = "LOGGING_DATA";
19616 const EXTRA_CRC: u8 = 193u8;
19617 const ENCODED_LEN: usize = 255usize;
19618 fn deser(
19619 _version: MavlinkVersion,
19620 __input: &[u8],
19621 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19622 let avail_len = __input.len();
19623 let mut payload_buf = [0; Self::ENCODED_LEN];
19624 let mut buf = if avail_len < Self::ENCODED_LEN {
19625 payload_buf[0..avail_len].copy_from_slice(__input);
19626 Bytes::new(&payload_buf)
19627 } else {
19628 Bytes::new(__input)
19629 };
19630 let mut __struct = Self::default();
19631 __struct.sequence = buf.get_u16_le()?;
19632 __struct.target_system = buf.get_u8()?;
19633 __struct.target_component = buf.get_u8()?;
19634 __struct.length = buf.get_u8()?;
19635 __struct.first_message_offset = buf.get_u8()?;
19636 for v in &mut __struct.data {
19637 let val = buf.get_u8()?;
19638 *v = val;
19639 }
19640 Ok(__struct)
19641 }
19642 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19643 let mut __tmp = BytesMut::new(bytes);
19644 #[allow(clippy::absurd_extreme_comparisons)]
19645 #[allow(unused_comparisons)]
19646 if __tmp.remaining() < Self::ENCODED_LEN {
19647 panic!(
19648 "buffer is too small (need {} bytes, but got {})",
19649 Self::ENCODED_LEN,
19650 __tmp.remaining(),
19651 )
19652 }
19653 __tmp.put_u16_le(self.sequence);
19654 __tmp.put_u8(self.target_system);
19655 __tmp.put_u8(self.target_component);
19656 __tmp.put_u8(self.length);
19657 __tmp.put_u8(self.first_message_offset);
19658 for val in &self.data {
19659 __tmp.put_u8(*val);
19660 }
19661 if matches!(version, MavlinkVersion::V2) {
19662 let len = __tmp.len();
19663 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19664 } else {
19665 __tmp.len()
19666 }
19667 }
19668}
19669#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
19670#[doc = ""]
19671#[doc = "ID: 267"]
19672#[derive(Debug, Clone, PartialEq)]
19673#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19675#[cfg_attr(feature = "ts", derive(TS))]
19676#[cfg_attr(feature = "ts", ts(export))]
19677pub struct LOGGING_DATA_ACKED_DATA {
19678 #[doc = "sequence number (can wrap)"]
19679 pub sequence: u16,
19680 #[doc = "system ID of the target"]
19681 pub target_system: u8,
19682 #[doc = "component ID of the target"]
19683 pub target_component: u8,
19684 #[doc = "data length"]
19685 pub length: u8,
19686 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
19687 pub first_message_offset: u8,
19688 #[doc = "logged data"]
19689 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19690 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19691 pub data: [u8; 249],
19692}
19693impl LOGGING_DATA_ACKED_DATA {
19694 pub const ENCODED_LEN: usize = 255usize;
19695 pub const DEFAULT: Self = Self {
19696 sequence: 0_u16,
19697 target_system: 0_u8,
19698 target_component: 0_u8,
19699 length: 0_u8,
19700 first_message_offset: 0_u8,
19701 data: [0_u8; 249usize],
19702 };
19703 #[cfg(feature = "arbitrary")]
19704 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19705 use arbitrary::{Arbitrary, Unstructured};
19706 let mut buf = [0u8; 1024];
19707 rng.fill_bytes(&mut buf);
19708 let mut unstructured = Unstructured::new(&buf);
19709 Self::arbitrary(&mut unstructured).unwrap_or_default()
19710 }
19711}
19712impl Default for LOGGING_DATA_ACKED_DATA {
19713 fn default() -> Self {
19714 Self::DEFAULT.clone()
19715 }
19716}
19717impl MessageData for LOGGING_DATA_ACKED_DATA {
19718 type Message = MavMessage;
19719 const ID: u32 = 267u32;
19720 const NAME: &'static str = "LOGGING_DATA_ACKED";
19721 const EXTRA_CRC: u8 = 35u8;
19722 const ENCODED_LEN: usize = 255usize;
19723 fn deser(
19724 _version: MavlinkVersion,
19725 __input: &[u8],
19726 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19727 let avail_len = __input.len();
19728 let mut payload_buf = [0; Self::ENCODED_LEN];
19729 let mut buf = if avail_len < Self::ENCODED_LEN {
19730 payload_buf[0..avail_len].copy_from_slice(__input);
19731 Bytes::new(&payload_buf)
19732 } else {
19733 Bytes::new(__input)
19734 };
19735 let mut __struct = Self::default();
19736 __struct.sequence = buf.get_u16_le()?;
19737 __struct.target_system = buf.get_u8()?;
19738 __struct.target_component = buf.get_u8()?;
19739 __struct.length = buf.get_u8()?;
19740 __struct.first_message_offset = buf.get_u8()?;
19741 for v in &mut __struct.data {
19742 let val = buf.get_u8()?;
19743 *v = val;
19744 }
19745 Ok(__struct)
19746 }
19747 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19748 let mut __tmp = BytesMut::new(bytes);
19749 #[allow(clippy::absurd_extreme_comparisons)]
19750 #[allow(unused_comparisons)]
19751 if __tmp.remaining() < Self::ENCODED_LEN {
19752 panic!(
19753 "buffer is too small (need {} bytes, but got {})",
19754 Self::ENCODED_LEN,
19755 __tmp.remaining(),
19756 )
19757 }
19758 __tmp.put_u16_le(self.sequence);
19759 __tmp.put_u8(self.target_system);
19760 __tmp.put_u8(self.target_component);
19761 __tmp.put_u8(self.length);
19762 __tmp.put_u8(self.first_message_offset);
19763 for val in &self.data {
19764 __tmp.put_u8(*val);
19765 }
19766 if matches!(version, MavlinkVersion::V2) {
19767 let len = __tmp.len();
19768 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19769 } else {
19770 __tmp.len()
19771 }
19772 }
19773}
19774#[doc = "Reply to LOG_REQUEST_DATA."]
19775#[doc = ""]
19776#[doc = "ID: 120"]
19777#[derive(Debug, Clone, PartialEq)]
19778#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19780#[cfg_attr(feature = "ts", derive(TS))]
19781#[cfg_attr(feature = "ts", ts(export))]
19782pub struct LOG_DATA_DATA {
19783 #[doc = "Offset into the log"]
19784 pub ofs: u32,
19785 #[doc = "Log id (from LOG_ENTRY reply)"]
19786 pub id: u16,
19787 #[doc = "Number of bytes (zero for end of log)"]
19788 pub count: u8,
19789 #[doc = "log data"]
19790 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19791 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19792 pub data: [u8; 90],
19793}
19794impl LOG_DATA_DATA {
19795 pub const ENCODED_LEN: usize = 97usize;
19796 pub const DEFAULT: Self = Self {
19797 ofs: 0_u32,
19798 id: 0_u16,
19799 count: 0_u8,
19800 data: [0_u8; 90usize],
19801 };
19802 #[cfg(feature = "arbitrary")]
19803 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19804 use arbitrary::{Arbitrary, Unstructured};
19805 let mut buf = [0u8; 1024];
19806 rng.fill_bytes(&mut buf);
19807 let mut unstructured = Unstructured::new(&buf);
19808 Self::arbitrary(&mut unstructured).unwrap_or_default()
19809 }
19810}
19811impl Default for LOG_DATA_DATA {
19812 fn default() -> Self {
19813 Self::DEFAULT.clone()
19814 }
19815}
19816impl MessageData for LOG_DATA_DATA {
19817 type Message = MavMessage;
19818 const ID: u32 = 120u32;
19819 const NAME: &'static str = "LOG_DATA";
19820 const EXTRA_CRC: u8 = 134u8;
19821 const ENCODED_LEN: usize = 97usize;
19822 fn deser(
19823 _version: MavlinkVersion,
19824 __input: &[u8],
19825 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19826 let avail_len = __input.len();
19827 let mut payload_buf = [0; Self::ENCODED_LEN];
19828 let mut buf = if avail_len < Self::ENCODED_LEN {
19829 payload_buf[0..avail_len].copy_from_slice(__input);
19830 Bytes::new(&payload_buf)
19831 } else {
19832 Bytes::new(__input)
19833 };
19834 let mut __struct = Self::default();
19835 __struct.ofs = buf.get_u32_le()?;
19836 __struct.id = buf.get_u16_le()?;
19837 __struct.count = buf.get_u8()?;
19838 for v in &mut __struct.data {
19839 let val = buf.get_u8()?;
19840 *v = val;
19841 }
19842 Ok(__struct)
19843 }
19844 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19845 let mut __tmp = BytesMut::new(bytes);
19846 #[allow(clippy::absurd_extreme_comparisons)]
19847 #[allow(unused_comparisons)]
19848 if __tmp.remaining() < Self::ENCODED_LEN {
19849 panic!(
19850 "buffer is too small (need {} bytes, but got {})",
19851 Self::ENCODED_LEN,
19852 __tmp.remaining(),
19853 )
19854 }
19855 __tmp.put_u32_le(self.ofs);
19856 __tmp.put_u16_le(self.id);
19857 __tmp.put_u8(self.count);
19858 for val in &self.data {
19859 __tmp.put_u8(*val);
19860 }
19861 if matches!(version, MavlinkVersion::V2) {
19862 let len = __tmp.len();
19863 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19864 } else {
19865 __tmp.len()
19866 }
19867 }
19868}
19869#[doc = "Reply to LOG_REQUEST_LIST."]
19870#[doc = ""]
19871#[doc = "ID: 118"]
19872#[derive(Debug, Clone, PartialEq)]
19873#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19874#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19875#[cfg_attr(feature = "ts", derive(TS))]
19876#[cfg_attr(feature = "ts", ts(export))]
19877pub struct LOG_ENTRY_DATA {
19878 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
19879 pub time_utc: u32,
19880 #[doc = "Size of the log (may be approximate)"]
19881 pub size: u32,
19882 #[doc = "Log id"]
19883 pub id: u16,
19884 #[doc = "Total number of logs"]
19885 pub num_logs: u16,
19886 #[doc = "High log number"]
19887 pub last_log_num: u16,
19888}
19889impl LOG_ENTRY_DATA {
19890 pub const ENCODED_LEN: usize = 14usize;
19891 pub const DEFAULT: Self = Self {
19892 time_utc: 0_u32,
19893 size: 0_u32,
19894 id: 0_u16,
19895 num_logs: 0_u16,
19896 last_log_num: 0_u16,
19897 };
19898 #[cfg(feature = "arbitrary")]
19899 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19900 use arbitrary::{Arbitrary, Unstructured};
19901 let mut buf = [0u8; 1024];
19902 rng.fill_bytes(&mut buf);
19903 let mut unstructured = Unstructured::new(&buf);
19904 Self::arbitrary(&mut unstructured).unwrap_or_default()
19905 }
19906}
19907impl Default for LOG_ENTRY_DATA {
19908 fn default() -> Self {
19909 Self::DEFAULT.clone()
19910 }
19911}
19912impl MessageData for LOG_ENTRY_DATA {
19913 type Message = MavMessage;
19914 const ID: u32 = 118u32;
19915 const NAME: &'static str = "LOG_ENTRY";
19916 const EXTRA_CRC: u8 = 56u8;
19917 const ENCODED_LEN: usize = 14usize;
19918 fn deser(
19919 _version: MavlinkVersion,
19920 __input: &[u8],
19921 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19922 let avail_len = __input.len();
19923 let mut payload_buf = [0; Self::ENCODED_LEN];
19924 let mut buf = if avail_len < Self::ENCODED_LEN {
19925 payload_buf[0..avail_len].copy_from_slice(__input);
19926 Bytes::new(&payload_buf)
19927 } else {
19928 Bytes::new(__input)
19929 };
19930 let mut __struct = Self::default();
19931 __struct.time_utc = buf.get_u32_le()?;
19932 __struct.size = buf.get_u32_le()?;
19933 __struct.id = buf.get_u16_le()?;
19934 __struct.num_logs = buf.get_u16_le()?;
19935 __struct.last_log_num = buf.get_u16_le()?;
19936 Ok(__struct)
19937 }
19938 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19939 let mut __tmp = BytesMut::new(bytes);
19940 #[allow(clippy::absurd_extreme_comparisons)]
19941 #[allow(unused_comparisons)]
19942 if __tmp.remaining() < Self::ENCODED_LEN {
19943 panic!(
19944 "buffer is too small (need {} bytes, but got {})",
19945 Self::ENCODED_LEN,
19946 __tmp.remaining(),
19947 )
19948 }
19949 __tmp.put_u32_le(self.time_utc);
19950 __tmp.put_u32_le(self.size);
19951 __tmp.put_u16_le(self.id);
19952 __tmp.put_u16_le(self.num_logs);
19953 __tmp.put_u16_le(self.last_log_num);
19954 if matches!(version, MavlinkVersion::V2) {
19955 let len = __tmp.len();
19956 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19957 } else {
19958 __tmp.len()
19959 }
19960 }
19961}
19962#[doc = "Erase all logs."]
19963#[doc = ""]
19964#[doc = "ID: 121"]
19965#[derive(Debug, Clone, PartialEq)]
19966#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19967#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19968#[cfg_attr(feature = "ts", derive(TS))]
19969#[cfg_attr(feature = "ts", ts(export))]
19970pub struct LOG_ERASE_DATA {
19971 #[doc = "System ID"]
19972 pub target_system: u8,
19973 #[doc = "Component ID"]
19974 pub target_component: u8,
19975}
19976impl LOG_ERASE_DATA {
19977 pub const ENCODED_LEN: usize = 2usize;
19978 pub const DEFAULT: Self = Self {
19979 target_system: 0_u8,
19980 target_component: 0_u8,
19981 };
19982 #[cfg(feature = "arbitrary")]
19983 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19984 use arbitrary::{Arbitrary, Unstructured};
19985 let mut buf = [0u8; 1024];
19986 rng.fill_bytes(&mut buf);
19987 let mut unstructured = Unstructured::new(&buf);
19988 Self::arbitrary(&mut unstructured).unwrap_or_default()
19989 }
19990}
19991impl Default for LOG_ERASE_DATA {
19992 fn default() -> Self {
19993 Self::DEFAULT.clone()
19994 }
19995}
19996impl MessageData for LOG_ERASE_DATA {
19997 type Message = MavMessage;
19998 const ID: u32 = 121u32;
19999 const NAME: &'static str = "LOG_ERASE";
20000 const EXTRA_CRC: u8 = 237u8;
20001 const ENCODED_LEN: usize = 2usize;
20002 fn deser(
20003 _version: MavlinkVersion,
20004 __input: &[u8],
20005 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20006 let avail_len = __input.len();
20007 let mut payload_buf = [0; Self::ENCODED_LEN];
20008 let mut buf = if avail_len < Self::ENCODED_LEN {
20009 payload_buf[0..avail_len].copy_from_slice(__input);
20010 Bytes::new(&payload_buf)
20011 } else {
20012 Bytes::new(__input)
20013 };
20014 let mut __struct = Self::default();
20015 __struct.target_system = buf.get_u8()?;
20016 __struct.target_component = buf.get_u8()?;
20017 Ok(__struct)
20018 }
20019 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20020 let mut __tmp = BytesMut::new(bytes);
20021 #[allow(clippy::absurd_extreme_comparisons)]
20022 #[allow(unused_comparisons)]
20023 if __tmp.remaining() < Self::ENCODED_LEN {
20024 panic!(
20025 "buffer is too small (need {} bytes, but got {})",
20026 Self::ENCODED_LEN,
20027 __tmp.remaining(),
20028 )
20029 }
20030 __tmp.put_u8(self.target_system);
20031 __tmp.put_u8(self.target_component);
20032 if matches!(version, MavlinkVersion::V2) {
20033 let len = __tmp.len();
20034 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20035 } else {
20036 __tmp.len()
20037 }
20038 }
20039}
20040#[doc = "Request a chunk of a log."]
20041#[doc = ""]
20042#[doc = "ID: 119"]
20043#[derive(Debug, Clone, PartialEq)]
20044#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20045#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20046#[cfg_attr(feature = "ts", derive(TS))]
20047#[cfg_attr(feature = "ts", ts(export))]
20048pub struct LOG_REQUEST_DATA_DATA {
20049 #[doc = "Offset into the log"]
20050 pub ofs: u32,
20051 #[doc = "Number of bytes"]
20052 pub count: u32,
20053 #[doc = "Log id (from LOG_ENTRY reply)"]
20054 pub id: u16,
20055 #[doc = "System ID"]
20056 pub target_system: u8,
20057 #[doc = "Component ID"]
20058 pub target_component: u8,
20059}
20060impl LOG_REQUEST_DATA_DATA {
20061 pub const ENCODED_LEN: usize = 12usize;
20062 pub const DEFAULT: Self = Self {
20063 ofs: 0_u32,
20064 count: 0_u32,
20065 id: 0_u16,
20066 target_system: 0_u8,
20067 target_component: 0_u8,
20068 };
20069 #[cfg(feature = "arbitrary")]
20070 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20071 use arbitrary::{Arbitrary, Unstructured};
20072 let mut buf = [0u8; 1024];
20073 rng.fill_bytes(&mut buf);
20074 let mut unstructured = Unstructured::new(&buf);
20075 Self::arbitrary(&mut unstructured).unwrap_or_default()
20076 }
20077}
20078impl Default for LOG_REQUEST_DATA_DATA {
20079 fn default() -> Self {
20080 Self::DEFAULT.clone()
20081 }
20082}
20083impl MessageData for LOG_REQUEST_DATA_DATA {
20084 type Message = MavMessage;
20085 const ID: u32 = 119u32;
20086 const NAME: &'static str = "LOG_REQUEST_DATA";
20087 const EXTRA_CRC: u8 = 116u8;
20088 const ENCODED_LEN: usize = 12usize;
20089 fn deser(
20090 _version: MavlinkVersion,
20091 __input: &[u8],
20092 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20093 let avail_len = __input.len();
20094 let mut payload_buf = [0; Self::ENCODED_LEN];
20095 let mut buf = if avail_len < Self::ENCODED_LEN {
20096 payload_buf[0..avail_len].copy_from_slice(__input);
20097 Bytes::new(&payload_buf)
20098 } else {
20099 Bytes::new(__input)
20100 };
20101 let mut __struct = Self::default();
20102 __struct.ofs = buf.get_u32_le()?;
20103 __struct.count = buf.get_u32_le()?;
20104 __struct.id = buf.get_u16_le()?;
20105 __struct.target_system = buf.get_u8()?;
20106 __struct.target_component = buf.get_u8()?;
20107 Ok(__struct)
20108 }
20109 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20110 let mut __tmp = BytesMut::new(bytes);
20111 #[allow(clippy::absurd_extreme_comparisons)]
20112 #[allow(unused_comparisons)]
20113 if __tmp.remaining() < Self::ENCODED_LEN {
20114 panic!(
20115 "buffer is too small (need {} bytes, but got {})",
20116 Self::ENCODED_LEN,
20117 __tmp.remaining(),
20118 )
20119 }
20120 __tmp.put_u32_le(self.ofs);
20121 __tmp.put_u32_le(self.count);
20122 __tmp.put_u16_le(self.id);
20123 __tmp.put_u8(self.target_system);
20124 __tmp.put_u8(self.target_component);
20125 if matches!(version, MavlinkVersion::V2) {
20126 let len = __tmp.len();
20127 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20128 } else {
20129 __tmp.len()
20130 }
20131 }
20132}
20133#[doc = "Stop log transfer and resume normal logging."]
20134#[doc = ""]
20135#[doc = "ID: 122"]
20136#[derive(Debug, Clone, PartialEq)]
20137#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20138#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20139#[cfg_attr(feature = "ts", derive(TS))]
20140#[cfg_attr(feature = "ts", ts(export))]
20141pub struct LOG_REQUEST_END_DATA {
20142 #[doc = "System ID"]
20143 pub target_system: u8,
20144 #[doc = "Component ID"]
20145 pub target_component: u8,
20146}
20147impl LOG_REQUEST_END_DATA {
20148 pub const ENCODED_LEN: usize = 2usize;
20149 pub const DEFAULT: Self = Self {
20150 target_system: 0_u8,
20151 target_component: 0_u8,
20152 };
20153 #[cfg(feature = "arbitrary")]
20154 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20155 use arbitrary::{Arbitrary, Unstructured};
20156 let mut buf = [0u8; 1024];
20157 rng.fill_bytes(&mut buf);
20158 let mut unstructured = Unstructured::new(&buf);
20159 Self::arbitrary(&mut unstructured).unwrap_or_default()
20160 }
20161}
20162impl Default for LOG_REQUEST_END_DATA {
20163 fn default() -> Self {
20164 Self::DEFAULT.clone()
20165 }
20166}
20167impl MessageData for LOG_REQUEST_END_DATA {
20168 type Message = MavMessage;
20169 const ID: u32 = 122u32;
20170 const NAME: &'static str = "LOG_REQUEST_END";
20171 const EXTRA_CRC: u8 = 203u8;
20172 const ENCODED_LEN: usize = 2usize;
20173 fn deser(
20174 _version: MavlinkVersion,
20175 __input: &[u8],
20176 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20177 let avail_len = __input.len();
20178 let mut payload_buf = [0; Self::ENCODED_LEN];
20179 let mut buf = if avail_len < Self::ENCODED_LEN {
20180 payload_buf[0..avail_len].copy_from_slice(__input);
20181 Bytes::new(&payload_buf)
20182 } else {
20183 Bytes::new(__input)
20184 };
20185 let mut __struct = Self::default();
20186 __struct.target_system = buf.get_u8()?;
20187 __struct.target_component = buf.get_u8()?;
20188 Ok(__struct)
20189 }
20190 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20191 let mut __tmp = BytesMut::new(bytes);
20192 #[allow(clippy::absurd_extreme_comparisons)]
20193 #[allow(unused_comparisons)]
20194 if __tmp.remaining() < Self::ENCODED_LEN {
20195 panic!(
20196 "buffer is too small (need {} bytes, but got {})",
20197 Self::ENCODED_LEN,
20198 __tmp.remaining(),
20199 )
20200 }
20201 __tmp.put_u8(self.target_system);
20202 __tmp.put_u8(self.target_component);
20203 if matches!(version, MavlinkVersion::V2) {
20204 let len = __tmp.len();
20205 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20206 } else {
20207 __tmp.len()
20208 }
20209 }
20210}
20211#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
20212#[doc = ""]
20213#[doc = "ID: 117"]
20214#[derive(Debug, Clone, PartialEq)]
20215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20216#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20217#[cfg_attr(feature = "ts", derive(TS))]
20218#[cfg_attr(feature = "ts", ts(export))]
20219pub struct LOG_REQUEST_LIST_DATA {
20220 #[doc = "First log id (0 for first available)"]
20221 pub start: u16,
20222 #[doc = "Last log id (0xffff for last available)"]
20223 pub end: u16,
20224 #[doc = "System ID"]
20225 pub target_system: u8,
20226 #[doc = "Component ID"]
20227 pub target_component: u8,
20228}
20229impl LOG_REQUEST_LIST_DATA {
20230 pub const ENCODED_LEN: usize = 6usize;
20231 pub const DEFAULT: Self = Self {
20232 start: 0_u16,
20233 end: 0_u16,
20234 target_system: 0_u8,
20235 target_component: 0_u8,
20236 };
20237 #[cfg(feature = "arbitrary")]
20238 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20239 use arbitrary::{Arbitrary, Unstructured};
20240 let mut buf = [0u8; 1024];
20241 rng.fill_bytes(&mut buf);
20242 let mut unstructured = Unstructured::new(&buf);
20243 Self::arbitrary(&mut unstructured).unwrap_or_default()
20244 }
20245}
20246impl Default for LOG_REQUEST_LIST_DATA {
20247 fn default() -> Self {
20248 Self::DEFAULT.clone()
20249 }
20250}
20251impl MessageData for LOG_REQUEST_LIST_DATA {
20252 type Message = MavMessage;
20253 const ID: u32 = 117u32;
20254 const NAME: &'static str = "LOG_REQUEST_LIST";
20255 const EXTRA_CRC: u8 = 128u8;
20256 const ENCODED_LEN: usize = 6usize;
20257 fn deser(
20258 _version: MavlinkVersion,
20259 __input: &[u8],
20260 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20261 let avail_len = __input.len();
20262 let mut payload_buf = [0; Self::ENCODED_LEN];
20263 let mut buf = if avail_len < Self::ENCODED_LEN {
20264 payload_buf[0..avail_len].copy_from_slice(__input);
20265 Bytes::new(&payload_buf)
20266 } else {
20267 Bytes::new(__input)
20268 };
20269 let mut __struct = Self::default();
20270 __struct.start = buf.get_u16_le()?;
20271 __struct.end = buf.get_u16_le()?;
20272 __struct.target_system = buf.get_u8()?;
20273 __struct.target_component = buf.get_u8()?;
20274 Ok(__struct)
20275 }
20276 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20277 let mut __tmp = BytesMut::new(bytes);
20278 #[allow(clippy::absurd_extreme_comparisons)]
20279 #[allow(unused_comparisons)]
20280 if __tmp.remaining() < Self::ENCODED_LEN {
20281 panic!(
20282 "buffer is too small (need {} bytes, but got {})",
20283 Self::ENCODED_LEN,
20284 __tmp.remaining(),
20285 )
20286 }
20287 __tmp.put_u16_le(self.start);
20288 __tmp.put_u16_le(self.end);
20289 __tmp.put_u8(self.target_system);
20290 __tmp.put_u8(self.target_component);
20291 if matches!(version, MavlinkVersion::V2) {
20292 let len = __tmp.len();
20293 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20294 } else {
20295 __tmp.len()
20296 }
20297 }
20298}
20299#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
20300#[doc = ""]
20301#[doc = "ID: 192"]
20302#[derive(Debug, Clone, PartialEq)]
20303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20305#[cfg_attr(feature = "ts", derive(TS))]
20306#[cfg_attr(feature = "ts", ts(export))]
20307pub struct MAG_CAL_REPORT_DATA {
20308 #[doc = "RMS milligauss residuals."]
20309 pub fitness: f32,
20310 #[doc = "X offset."]
20311 pub ofs_x: f32,
20312 #[doc = "Y offset."]
20313 pub ofs_y: f32,
20314 #[doc = "Z offset."]
20315 pub ofs_z: f32,
20316 #[doc = "X diagonal (matrix 11)."]
20317 pub diag_x: f32,
20318 #[doc = "Y diagonal (matrix 22)."]
20319 pub diag_y: f32,
20320 #[doc = "Z diagonal (matrix 33)."]
20321 pub diag_z: f32,
20322 #[doc = "X off-diagonal (matrix 12 and 21)."]
20323 pub offdiag_x: f32,
20324 #[doc = "Y off-diagonal (matrix 13 and 31)."]
20325 pub offdiag_y: f32,
20326 #[doc = "Z off-diagonal (matrix 32 and 23)."]
20327 pub offdiag_z: f32,
20328 #[doc = "Compass being calibrated."]
20329 pub compass_id: u8,
20330 #[doc = "Bitmask of compasses being calibrated."]
20331 pub cal_mask: u8,
20332 #[doc = "Calibration Status."]
20333 pub cal_status: MagCalStatus,
20334 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
20335 pub autosaved: u8,
20336 #[doc = "Confidence in orientation (higher is better)."]
20337 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20338 pub orientation_confidence: f32,
20339 #[doc = "orientation before calibration."]
20340 #[cfg_attr(feature = "serde", serde(default))]
20341 pub old_orientation: MavSensorOrientation,
20342 #[doc = "orientation after calibration."]
20343 #[cfg_attr(feature = "serde", serde(default))]
20344 pub new_orientation: MavSensorOrientation,
20345 #[doc = "field radius correction factor"]
20346 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20347 pub scale_factor: f32,
20348}
20349impl MAG_CAL_REPORT_DATA {
20350 pub const ENCODED_LEN: usize = 54usize;
20351 pub const DEFAULT: Self = Self {
20352 fitness: 0.0_f32,
20353 ofs_x: 0.0_f32,
20354 ofs_y: 0.0_f32,
20355 ofs_z: 0.0_f32,
20356 diag_x: 0.0_f32,
20357 diag_y: 0.0_f32,
20358 diag_z: 0.0_f32,
20359 offdiag_x: 0.0_f32,
20360 offdiag_y: 0.0_f32,
20361 offdiag_z: 0.0_f32,
20362 compass_id: 0_u8,
20363 cal_mask: 0_u8,
20364 cal_status: MagCalStatus::DEFAULT,
20365 autosaved: 0_u8,
20366 orientation_confidence: 0.0_f32,
20367 old_orientation: MavSensorOrientation::DEFAULT,
20368 new_orientation: MavSensorOrientation::DEFAULT,
20369 scale_factor: 0.0_f32,
20370 };
20371 #[cfg(feature = "arbitrary")]
20372 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20373 use arbitrary::{Arbitrary, Unstructured};
20374 let mut buf = [0u8; 1024];
20375 rng.fill_bytes(&mut buf);
20376 let mut unstructured = Unstructured::new(&buf);
20377 Self::arbitrary(&mut unstructured).unwrap_or_default()
20378 }
20379}
20380impl Default for MAG_CAL_REPORT_DATA {
20381 fn default() -> Self {
20382 Self::DEFAULT.clone()
20383 }
20384}
20385impl MessageData for MAG_CAL_REPORT_DATA {
20386 type Message = MavMessage;
20387 const ID: u32 = 192u32;
20388 const NAME: &'static str = "MAG_CAL_REPORT";
20389 const EXTRA_CRC: u8 = 36u8;
20390 const ENCODED_LEN: usize = 54usize;
20391 fn deser(
20392 _version: MavlinkVersion,
20393 __input: &[u8],
20394 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20395 let avail_len = __input.len();
20396 let mut payload_buf = [0; Self::ENCODED_LEN];
20397 let mut buf = if avail_len < Self::ENCODED_LEN {
20398 payload_buf[0..avail_len].copy_from_slice(__input);
20399 Bytes::new(&payload_buf)
20400 } else {
20401 Bytes::new(__input)
20402 };
20403 let mut __struct = Self::default();
20404 __struct.fitness = buf.get_f32_le()?;
20405 __struct.ofs_x = buf.get_f32_le()?;
20406 __struct.ofs_y = buf.get_f32_le()?;
20407 __struct.ofs_z = buf.get_f32_le()?;
20408 __struct.diag_x = buf.get_f32_le()?;
20409 __struct.diag_y = buf.get_f32_le()?;
20410 __struct.diag_z = buf.get_f32_le()?;
20411 __struct.offdiag_x = buf.get_f32_le()?;
20412 __struct.offdiag_y = buf.get_f32_le()?;
20413 __struct.offdiag_z = buf.get_f32_le()?;
20414 __struct.compass_id = buf.get_u8()?;
20415 __struct.cal_mask = buf.get_u8()?;
20416 let tmp = buf.get_u8()?;
20417 __struct.cal_status =
20418 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20419 enum_type: "MagCalStatus",
20420 value: tmp as u64,
20421 })?;
20422 __struct.autosaved = buf.get_u8()?;
20423 __struct.orientation_confidence = buf.get_f32_le()?;
20424 let tmp = buf.get_u8()?;
20425 __struct.old_orientation =
20426 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20427 enum_type: "MavSensorOrientation",
20428 value: tmp as u64,
20429 })?;
20430 let tmp = buf.get_u8()?;
20431 __struct.new_orientation =
20432 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20433 enum_type: "MavSensorOrientation",
20434 value: tmp as u64,
20435 })?;
20436 __struct.scale_factor = buf.get_f32_le()?;
20437 Ok(__struct)
20438 }
20439 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20440 let mut __tmp = BytesMut::new(bytes);
20441 #[allow(clippy::absurd_extreme_comparisons)]
20442 #[allow(unused_comparisons)]
20443 if __tmp.remaining() < Self::ENCODED_LEN {
20444 panic!(
20445 "buffer is too small (need {} bytes, but got {})",
20446 Self::ENCODED_LEN,
20447 __tmp.remaining(),
20448 )
20449 }
20450 __tmp.put_f32_le(self.fitness);
20451 __tmp.put_f32_le(self.ofs_x);
20452 __tmp.put_f32_le(self.ofs_y);
20453 __tmp.put_f32_le(self.ofs_z);
20454 __tmp.put_f32_le(self.diag_x);
20455 __tmp.put_f32_le(self.diag_y);
20456 __tmp.put_f32_le(self.diag_z);
20457 __tmp.put_f32_le(self.offdiag_x);
20458 __tmp.put_f32_le(self.offdiag_y);
20459 __tmp.put_f32_le(self.offdiag_z);
20460 __tmp.put_u8(self.compass_id);
20461 __tmp.put_u8(self.cal_mask);
20462 __tmp.put_u8(self.cal_status as u8);
20463 __tmp.put_u8(self.autosaved);
20464 if matches!(version, MavlinkVersion::V2) {
20465 __tmp.put_f32_le(self.orientation_confidence);
20466 __tmp.put_u8(self.old_orientation as u8);
20467 __tmp.put_u8(self.new_orientation as u8);
20468 __tmp.put_f32_le(self.scale_factor);
20469 let len = __tmp.len();
20470 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20471 } else {
20472 __tmp.len()
20473 }
20474 }
20475}
20476#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
20477#[doc = ""]
20478#[doc = "ID: 69"]
20479#[derive(Debug, Clone, PartialEq)]
20480#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20481#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20482#[cfg_attr(feature = "ts", derive(TS))]
20483#[cfg_attr(feature = "ts", ts(export))]
20484pub struct MANUAL_CONTROL_DATA {
20485 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
20486 pub x: i16,
20487 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
20488 pub y: i16,
20489 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
20490 pub z: i16,
20491 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
20492 pub r: i16,
20493 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
20494 pub buttons: u16,
20495 #[doc = "The system to be controlled."]
20496 pub target: u8,
20497 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
20498 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20499 pub buttons2: u16,
20500 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
20501 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20502 pub enabled_extensions: u8,
20503 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
20504 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20505 pub s: i16,
20506 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
20507 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20508 pub t: i16,
20509 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
20510 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20511 pub aux1: i16,
20512 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
20513 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20514 pub aux2: i16,
20515 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
20516 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20517 pub aux3: i16,
20518 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
20519 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20520 pub aux4: i16,
20521 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
20522 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20523 pub aux5: i16,
20524 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
20525 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20526 pub aux6: i16,
20527}
20528impl MANUAL_CONTROL_DATA {
20529 pub const ENCODED_LEN: usize = 30usize;
20530 pub const DEFAULT: Self = Self {
20531 x: 0_i16,
20532 y: 0_i16,
20533 z: 0_i16,
20534 r: 0_i16,
20535 buttons: 0_u16,
20536 target: 0_u8,
20537 buttons2: 0_u16,
20538 enabled_extensions: 0_u8,
20539 s: 0_i16,
20540 t: 0_i16,
20541 aux1: 0_i16,
20542 aux2: 0_i16,
20543 aux3: 0_i16,
20544 aux4: 0_i16,
20545 aux5: 0_i16,
20546 aux6: 0_i16,
20547 };
20548 #[cfg(feature = "arbitrary")]
20549 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20550 use arbitrary::{Arbitrary, Unstructured};
20551 let mut buf = [0u8; 1024];
20552 rng.fill_bytes(&mut buf);
20553 let mut unstructured = Unstructured::new(&buf);
20554 Self::arbitrary(&mut unstructured).unwrap_or_default()
20555 }
20556}
20557impl Default for MANUAL_CONTROL_DATA {
20558 fn default() -> Self {
20559 Self::DEFAULT.clone()
20560 }
20561}
20562impl MessageData for MANUAL_CONTROL_DATA {
20563 type Message = MavMessage;
20564 const ID: u32 = 69u32;
20565 const NAME: &'static str = "MANUAL_CONTROL";
20566 const EXTRA_CRC: u8 = 243u8;
20567 const ENCODED_LEN: usize = 30usize;
20568 fn deser(
20569 _version: MavlinkVersion,
20570 __input: &[u8],
20571 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20572 let avail_len = __input.len();
20573 let mut payload_buf = [0; Self::ENCODED_LEN];
20574 let mut buf = if avail_len < Self::ENCODED_LEN {
20575 payload_buf[0..avail_len].copy_from_slice(__input);
20576 Bytes::new(&payload_buf)
20577 } else {
20578 Bytes::new(__input)
20579 };
20580 let mut __struct = Self::default();
20581 __struct.x = buf.get_i16_le()?;
20582 __struct.y = buf.get_i16_le()?;
20583 __struct.z = buf.get_i16_le()?;
20584 __struct.r = buf.get_i16_le()?;
20585 __struct.buttons = buf.get_u16_le()?;
20586 __struct.target = buf.get_u8()?;
20587 __struct.buttons2 = buf.get_u16_le()?;
20588 __struct.enabled_extensions = buf.get_u8()?;
20589 __struct.s = buf.get_i16_le()?;
20590 __struct.t = buf.get_i16_le()?;
20591 __struct.aux1 = buf.get_i16_le()?;
20592 __struct.aux2 = buf.get_i16_le()?;
20593 __struct.aux3 = buf.get_i16_le()?;
20594 __struct.aux4 = buf.get_i16_le()?;
20595 __struct.aux5 = buf.get_i16_le()?;
20596 __struct.aux6 = buf.get_i16_le()?;
20597 Ok(__struct)
20598 }
20599 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20600 let mut __tmp = BytesMut::new(bytes);
20601 #[allow(clippy::absurd_extreme_comparisons)]
20602 #[allow(unused_comparisons)]
20603 if __tmp.remaining() < Self::ENCODED_LEN {
20604 panic!(
20605 "buffer is too small (need {} bytes, but got {})",
20606 Self::ENCODED_LEN,
20607 __tmp.remaining(),
20608 )
20609 }
20610 __tmp.put_i16_le(self.x);
20611 __tmp.put_i16_le(self.y);
20612 __tmp.put_i16_le(self.z);
20613 __tmp.put_i16_le(self.r);
20614 __tmp.put_u16_le(self.buttons);
20615 __tmp.put_u8(self.target);
20616 if matches!(version, MavlinkVersion::V2) {
20617 __tmp.put_u16_le(self.buttons2);
20618 __tmp.put_u8(self.enabled_extensions);
20619 __tmp.put_i16_le(self.s);
20620 __tmp.put_i16_le(self.t);
20621 __tmp.put_i16_le(self.aux1);
20622 __tmp.put_i16_le(self.aux2);
20623 __tmp.put_i16_le(self.aux3);
20624 __tmp.put_i16_le(self.aux4);
20625 __tmp.put_i16_le(self.aux5);
20626 __tmp.put_i16_le(self.aux6);
20627 let len = __tmp.len();
20628 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20629 } else {
20630 __tmp.len()
20631 }
20632 }
20633}
20634#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
20635#[doc = ""]
20636#[doc = "ID: 81"]
20637#[derive(Debug, Clone, PartialEq)]
20638#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20639#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20640#[cfg_attr(feature = "ts", derive(TS))]
20641#[cfg_attr(feature = "ts", ts(export))]
20642pub struct MANUAL_SETPOINT_DATA {
20643 #[doc = "Timestamp (time since system boot)."]
20644 pub time_boot_ms: u32,
20645 #[doc = "Desired roll rate"]
20646 pub roll: f32,
20647 #[doc = "Desired pitch rate"]
20648 pub pitch: f32,
20649 #[doc = "Desired yaw rate"]
20650 pub yaw: f32,
20651 #[doc = "Collective thrust, normalized to 0 .. 1"]
20652 pub thrust: f32,
20653 #[doc = "Flight mode switch position, 0.. 255"]
20654 pub mode_switch: u8,
20655 #[doc = "Override mode switch position, 0.. 255"]
20656 pub manual_override_switch: u8,
20657}
20658impl MANUAL_SETPOINT_DATA {
20659 pub const ENCODED_LEN: usize = 22usize;
20660 pub const DEFAULT: Self = Self {
20661 time_boot_ms: 0_u32,
20662 roll: 0.0_f32,
20663 pitch: 0.0_f32,
20664 yaw: 0.0_f32,
20665 thrust: 0.0_f32,
20666 mode_switch: 0_u8,
20667 manual_override_switch: 0_u8,
20668 };
20669 #[cfg(feature = "arbitrary")]
20670 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20671 use arbitrary::{Arbitrary, Unstructured};
20672 let mut buf = [0u8; 1024];
20673 rng.fill_bytes(&mut buf);
20674 let mut unstructured = Unstructured::new(&buf);
20675 Self::arbitrary(&mut unstructured).unwrap_or_default()
20676 }
20677}
20678impl Default for MANUAL_SETPOINT_DATA {
20679 fn default() -> Self {
20680 Self::DEFAULT.clone()
20681 }
20682}
20683impl MessageData for MANUAL_SETPOINT_DATA {
20684 type Message = MavMessage;
20685 const ID: u32 = 81u32;
20686 const NAME: &'static str = "MANUAL_SETPOINT";
20687 const EXTRA_CRC: u8 = 106u8;
20688 const ENCODED_LEN: usize = 22usize;
20689 fn deser(
20690 _version: MavlinkVersion,
20691 __input: &[u8],
20692 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20693 let avail_len = __input.len();
20694 let mut payload_buf = [0; Self::ENCODED_LEN];
20695 let mut buf = if avail_len < Self::ENCODED_LEN {
20696 payload_buf[0..avail_len].copy_from_slice(__input);
20697 Bytes::new(&payload_buf)
20698 } else {
20699 Bytes::new(__input)
20700 };
20701 let mut __struct = Self::default();
20702 __struct.time_boot_ms = buf.get_u32_le()?;
20703 __struct.roll = buf.get_f32_le()?;
20704 __struct.pitch = buf.get_f32_le()?;
20705 __struct.yaw = buf.get_f32_le()?;
20706 __struct.thrust = buf.get_f32_le()?;
20707 __struct.mode_switch = buf.get_u8()?;
20708 __struct.manual_override_switch = buf.get_u8()?;
20709 Ok(__struct)
20710 }
20711 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20712 let mut __tmp = BytesMut::new(bytes);
20713 #[allow(clippy::absurd_extreme_comparisons)]
20714 #[allow(unused_comparisons)]
20715 if __tmp.remaining() < Self::ENCODED_LEN {
20716 panic!(
20717 "buffer is too small (need {} bytes, but got {})",
20718 Self::ENCODED_LEN,
20719 __tmp.remaining(),
20720 )
20721 }
20722 __tmp.put_u32_le(self.time_boot_ms);
20723 __tmp.put_f32_le(self.roll);
20724 __tmp.put_f32_le(self.pitch);
20725 __tmp.put_f32_le(self.yaw);
20726 __tmp.put_f32_le(self.thrust);
20727 __tmp.put_u8(self.mode_switch);
20728 __tmp.put_u8(self.manual_override_switch);
20729 if matches!(version, MavlinkVersion::V2) {
20730 let len = __tmp.len();
20731 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20732 } else {
20733 __tmp.len()
20734 }
20735 }
20736}
20737#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20738#[doc = ""]
20739#[doc = "ID: 249"]
20740#[derive(Debug, Clone, PartialEq)]
20741#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20742#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20743#[cfg_attr(feature = "ts", derive(TS))]
20744#[cfg_attr(feature = "ts", ts(export))]
20745pub struct MEMORY_VECT_DATA {
20746 #[doc = "Starting address of the debug variables"]
20747 pub address: u16,
20748 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
20749 pub ver: u8,
20750 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
20751 pub mavtype: u8,
20752 #[doc = "Memory contents at specified address"]
20753 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20754 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
20755 pub value: [i8; 32],
20756}
20757impl MEMORY_VECT_DATA {
20758 pub const ENCODED_LEN: usize = 36usize;
20759 pub const DEFAULT: Self = Self {
20760 address: 0_u16,
20761 ver: 0_u8,
20762 mavtype: 0_u8,
20763 value: [0_i8; 32usize],
20764 };
20765 #[cfg(feature = "arbitrary")]
20766 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20767 use arbitrary::{Arbitrary, Unstructured};
20768 let mut buf = [0u8; 1024];
20769 rng.fill_bytes(&mut buf);
20770 let mut unstructured = Unstructured::new(&buf);
20771 Self::arbitrary(&mut unstructured).unwrap_or_default()
20772 }
20773}
20774impl Default for MEMORY_VECT_DATA {
20775 fn default() -> Self {
20776 Self::DEFAULT.clone()
20777 }
20778}
20779impl MessageData for MEMORY_VECT_DATA {
20780 type Message = MavMessage;
20781 const ID: u32 = 249u32;
20782 const NAME: &'static str = "MEMORY_VECT";
20783 const EXTRA_CRC: u8 = 204u8;
20784 const ENCODED_LEN: usize = 36usize;
20785 fn deser(
20786 _version: MavlinkVersion,
20787 __input: &[u8],
20788 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20789 let avail_len = __input.len();
20790 let mut payload_buf = [0; Self::ENCODED_LEN];
20791 let mut buf = if avail_len < Self::ENCODED_LEN {
20792 payload_buf[0..avail_len].copy_from_slice(__input);
20793 Bytes::new(&payload_buf)
20794 } else {
20795 Bytes::new(__input)
20796 };
20797 let mut __struct = Self::default();
20798 __struct.address = buf.get_u16_le()?;
20799 __struct.ver = buf.get_u8()?;
20800 __struct.mavtype = buf.get_u8()?;
20801 for v in &mut __struct.value {
20802 let val = buf.get_i8()?;
20803 *v = val;
20804 }
20805 Ok(__struct)
20806 }
20807 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20808 let mut __tmp = BytesMut::new(bytes);
20809 #[allow(clippy::absurd_extreme_comparisons)]
20810 #[allow(unused_comparisons)]
20811 if __tmp.remaining() < Self::ENCODED_LEN {
20812 panic!(
20813 "buffer is too small (need {} bytes, but got {})",
20814 Self::ENCODED_LEN,
20815 __tmp.remaining(),
20816 )
20817 }
20818 __tmp.put_u16_le(self.address);
20819 __tmp.put_u8(self.ver);
20820 __tmp.put_u8(self.mavtype);
20821 for val in &self.value {
20822 __tmp.put_i8(*val);
20823 }
20824 if matches!(version, MavlinkVersion::V2) {
20825 let len = __tmp.len();
20826 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20827 } else {
20828 __tmp.len()
20829 }
20830 }
20831}
20832#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
20833#[doc = ""]
20834#[doc = "ID: 244"]
20835#[derive(Debug, Clone, PartialEq)]
20836#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20837#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20838#[cfg_attr(feature = "ts", derive(TS))]
20839#[cfg_attr(feature = "ts", ts(export))]
20840pub struct MESSAGE_INTERVAL_DATA {
20841 #[doc = "The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available,>0 indicates the interval at which it is sent."]
20842 pub interval_us: i32,
20843 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
20844 pub message_id: u16,
20845}
20846impl MESSAGE_INTERVAL_DATA {
20847 pub const ENCODED_LEN: usize = 6usize;
20848 pub const DEFAULT: Self = Self {
20849 interval_us: 0_i32,
20850 message_id: 0_u16,
20851 };
20852 #[cfg(feature = "arbitrary")]
20853 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20854 use arbitrary::{Arbitrary, Unstructured};
20855 let mut buf = [0u8; 1024];
20856 rng.fill_bytes(&mut buf);
20857 let mut unstructured = Unstructured::new(&buf);
20858 Self::arbitrary(&mut unstructured).unwrap_or_default()
20859 }
20860}
20861impl Default for MESSAGE_INTERVAL_DATA {
20862 fn default() -> Self {
20863 Self::DEFAULT.clone()
20864 }
20865}
20866impl MessageData for MESSAGE_INTERVAL_DATA {
20867 type Message = MavMessage;
20868 const ID: u32 = 244u32;
20869 const NAME: &'static str = "MESSAGE_INTERVAL";
20870 const EXTRA_CRC: u8 = 95u8;
20871 const ENCODED_LEN: usize = 6usize;
20872 fn deser(
20873 _version: MavlinkVersion,
20874 __input: &[u8],
20875 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20876 let avail_len = __input.len();
20877 let mut payload_buf = [0; Self::ENCODED_LEN];
20878 let mut buf = if avail_len < Self::ENCODED_LEN {
20879 payload_buf[0..avail_len].copy_from_slice(__input);
20880 Bytes::new(&payload_buf)
20881 } else {
20882 Bytes::new(__input)
20883 };
20884 let mut __struct = Self::default();
20885 __struct.interval_us = buf.get_i32_le()?;
20886 __struct.message_id = buf.get_u16_le()?;
20887 Ok(__struct)
20888 }
20889 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20890 let mut __tmp = BytesMut::new(bytes);
20891 #[allow(clippy::absurd_extreme_comparisons)]
20892 #[allow(unused_comparisons)]
20893 if __tmp.remaining() < Self::ENCODED_LEN {
20894 panic!(
20895 "buffer is too small (need {} bytes, but got {})",
20896 Self::ENCODED_LEN,
20897 __tmp.remaining(),
20898 )
20899 }
20900 __tmp.put_i32_le(self.interval_us);
20901 __tmp.put_u16_le(self.message_id);
20902 if matches!(version, MavlinkVersion::V2) {
20903 let len = __tmp.len();
20904 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20905 } else {
20906 __tmp.len()
20907 }
20908 }
20909}
20910#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
20911#[doc = ""]
20912#[doc = "ID: 47"]
20913#[derive(Debug, Clone, PartialEq)]
20914#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20916#[cfg_attr(feature = "ts", derive(TS))]
20917#[cfg_attr(feature = "ts", ts(export))]
20918pub struct MISSION_ACK_DATA {
20919 #[doc = "System ID"]
20920 pub target_system: u8,
20921 #[doc = "Component ID"]
20922 pub target_component: u8,
20923 #[doc = "Mission result."]
20924 pub mavtype: MavMissionResult,
20925 #[doc = "Mission type."]
20926 #[cfg_attr(feature = "serde", serde(default))]
20927 pub mission_type: MavMissionType,
20928 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
20929 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20930 pub opaque_id: u32,
20931}
20932impl MISSION_ACK_DATA {
20933 pub const ENCODED_LEN: usize = 8usize;
20934 pub const DEFAULT: Self = Self {
20935 target_system: 0_u8,
20936 target_component: 0_u8,
20937 mavtype: MavMissionResult::DEFAULT,
20938 mission_type: MavMissionType::DEFAULT,
20939 opaque_id: 0_u32,
20940 };
20941 #[cfg(feature = "arbitrary")]
20942 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20943 use arbitrary::{Arbitrary, Unstructured};
20944 let mut buf = [0u8; 1024];
20945 rng.fill_bytes(&mut buf);
20946 let mut unstructured = Unstructured::new(&buf);
20947 Self::arbitrary(&mut unstructured).unwrap_or_default()
20948 }
20949}
20950impl Default for MISSION_ACK_DATA {
20951 fn default() -> Self {
20952 Self::DEFAULT.clone()
20953 }
20954}
20955impl MessageData for MISSION_ACK_DATA {
20956 type Message = MavMessage;
20957 const ID: u32 = 47u32;
20958 const NAME: &'static str = "MISSION_ACK";
20959 const EXTRA_CRC: u8 = 153u8;
20960 const ENCODED_LEN: usize = 8usize;
20961 fn deser(
20962 _version: MavlinkVersion,
20963 __input: &[u8],
20964 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20965 let avail_len = __input.len();
20966 let mut payload_buf = [0; Self::ENCODED_LEN];
20967 let mut buf = if avail_len < Self::ENCODED_LEN {
20968 payload_buf[0..avail_len].copy_from_slice(__input);
20969 Bytes::new(&payload_buf)
20970 } else {
20971 Bytes::new(__input)
20972 };
20973 let mut __struct = Self::default();
20974 __struct.target_system = buf.get_u8()?;
20975 __struct.target_component = buf.get_u8()?;
20976 let tmp = buf.get_u8()?;
20977 __struct.mavtype =
20978 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20979 enum_type: "MavMissionResult",
20980 value: tmp as u64,
20981 })?;
20982 let tmp = buf.get_u8()?;
20983 __struct.mission_type =
20984 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20985 enum_type: "MavMissionType",
20986 value: tmp as u64,
20987 })?;
20988 __struct.opaque_id = buf.get_u32_le()?;
20989 Ok(__struct)
20990 }
20991 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20992 let mut __tmp = BytesMut::new(bytes);
20993 #[allow(clippy::absurd_extreme_comparisons)]
20994 #[allow(unused_comparisons)]
20995 if __tmp.remaining() < Self::ENCODED_LEN {
20996 panic!(
20997 "buffer is too small (need {} bytes, but got {})",
20998 Self::ENCODED_LEN,
20999 __tmp.remaining(),
21000 )
21001 }
21002 __tmp.put_u8(self.target_system);
21003 __tmp.put_u8(self.target_component);
21004 __tmp.put_u8(self.mavtype as u8);
21005 if matches!(version, MavlinkVersion::V2) {
21006 __tmp.put_u8(self.mission_type as u8);
21007 __tmp.put_u32_le(self.opaque_id);
21008 let len = __tmp.len();
21009 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21010 } else {
21011 __tmp.len()
21012 }
21013 }
21014}
21015#[doc = "Delete all mission items at once."]
21016#[doc = ""]
21017#[doc = "ID: 45"]
21018#[derive(Debug, Clone, PartialEq)]
21019#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21020#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21021#[cfg_attr(feature = "ts", derive(TS))]
21022#[cfg_attr(feature = "ts", ts(export))]
21023pub struct MISSION_CLEAR_ALL_DATA {
21024 #[doc = "System ID"]
21025 pub target_system: u8,
21026 #[doc = "Component ID"]
21027 pub target_component: u8,
21028 #[doc = "Mission type."]
21029 #[cfg_attr(feature = "serde", serde(default))]
21030 pub mission_type: MavMissionType,
21031}
21032impl MISSION_CLEAR_ALL_DATA {
21033 pub const ENCODED_LEN: usize = 3usize;
21034 pub const DEFAULT: Self = Self {
21035 target_system: 0_u8,
21036 target_component: 0_u8,
21037 mission_type: MavMissionType::DEFAULT,
21038 };
21039 #[cfg(feature = "arbitrary")]
21040 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21041 use arbitrary::{Arbitrary, Unstructured};
21042 let mut buf = [0u8; 1024];
21043 rng.fill_bytes(&mut buf);
21044 let mut unstructured = Unstructured::new(&buf);
21045 Self::arbitrary(&mut unstructured).unwrap_or_default()
21046 }
21047}
21048impl Default for MISSION_CLEAR_ALL_DATA {
21049 fn default() -> Self {
21050 Self::DEFAULT.clone()
21051 }
21052}
21053impl MessageData for MISSION_CLEAR_ALL_DATA {
21054 type Message = MavMessage;
21055 const ID: u32 = 45u32;
21056 const NAME: &'static str = "MISSION_CLEAR_ALL";
21057 const EXTRA_CRC: u8 = 232u8;
21058 const ENCODED_LEN: usize = 3usize;
21059 fn deser(
21060 _version: MavlinkVersion,
21061 __input: &[u8],
21062 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21063 let avail_len = __input.len();
21064 let mut payload_buf = [0; Self::ENCODED_LEN];
21065 let mut buf = if avail_len < Self::ENCODED_LEN {
21066 payload_buf[0..avail_len].copy_from_slice(__input);
21067 Bytes::new(&payload_buf)
21068 } else {
21069 Bytes::new(__input)
21070 };
21071 let mut __struct = Self::default();
21072 __struct.target_system = buf.get_u8()?;
21073 __struct.target_component = buf.get_u8()?;
21074 let tmp = buf.get_u8()?;
21075 __struct.mission_type =
21076 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21077 enum_type: "MavMissionType",
21078 value: tmp as u64,
21079 })?;
21080 Ok(__struct)
21081 }
21082 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21083 let mut __tmp = BytesMut::new(bytes);
21084 #[allow(clippy::absurd_extreme_comparisons)]
21085 #[allow(unused_comparisons)]
21086 if __tmp.remaining() < Self::ENCODED_LEN {
21087 panic!(
21088 "buffer is too small (need {} bytes, but got {})",
21089 Self::ENCODED_LEN,
21090 __tmp.remaining(),
21091 )
21092 }
21093 __tmp.put_u8(self.target_system);
21094 __tmp.put_u8(self.target_component);
21095 if matches!(version, MavlinkVersion::V2) {
21096 __tmp.put_u8(self.mission_type as u8);
21097 let len = __tmp.len();
21098 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21099 } else {
21100 __tmp.len()
21101 }
21102 }
21103}
21104#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
21105#[doc = ""]
21106#[doc = "ID: 44"]
21107#[derive(Debug, Clone, PartialEq)]
21108#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21109#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21110#[cfg_attr(feature = "ts", derive(TS))]
21111#[cfg_attr(feature = "ts", ts(export))]
21112pub struct MISSION_COUNT_DATA {
21113 #[doc = "Number of mission items in the sequence"]
21114 pub count: u16,
21115 #[doc = "System ID"]
21116 pub target_system: u8,
21117 #[doc = "Component ID"]
21118 pub target_component: u8,
21119 #[doc = "Mission type."]
21120 #[cfg_attr(feature = "serde", serde(default))]
21121 pub mission_type: MavMissionType,
21122 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
21123 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21124 pub opaque_id: u32,
21125}
21126impl MISSION_COUNT_DATA {
21127 pub const ENCODED_LEN: usize = 9usize;
21128 pub const DEFAULT: Self = Self {
21129 count: 0_u16,
21130 target_system: 0_u8,
21131 target_component: 0_u8,
21132 mission_type: MavMissionType::DEFAULT,
21133 opaque_id: 0_u32,
21134 };
21135 #[cfg(feature = "arbitrary")]
21136 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21137 use arbitrary::{Arbitrary, Unstructured};
21138 let mut buf = [0u8; 1024];
21139 rng.fill_bytes(&mut buf);
21140 let mut unstructured = Unstructured::new(&buf);
21141 Self::arbitrary(&mut unstructured).unwrap_or_default()
21142 }
21143}
21144impl Default for MISSION_COUNT_DATA {
21145 fn default() -> Self {
21146 Self::DEFAULT.clone()
21147 }
21148}
21149impl MessageData for MISSION_COUNT_DATA {
21150 type Message = MavMessage;
21151 const ID: u32 = 44u32;
21152 const NAME: &'static str = "MISSION_COUNT";
21153 const EXTRA_CRC: u8 = 221u8;
21154 const ENCODED_LEN: usize = 9usize;
21155 fn deser(
21156 _version: MavlinkVersion,
21157 __input: &[u8],
21158 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21159 let avail_len = __input.len();
21160 let mut payload_buf = [0; Self::ENCODED_LEN];
21161 let mut buf = if avail_len < Self::ENCODED_LEN {
21162 payload_buf[0..avail_len].copy_from_slice(__input);
21163 Bytes::new(&payload_buf)
21164 } else {
21165 Bytes::new(__input)
21166 };
21167 let mut __struct = Self::default();
21168 __struct.count = buf.get_u16_le()?;
21169 __struct.target_system = buf.get_u8()?;
21170 __struct.target_component = buf.get_u8()?;
21171 let tmp = buf.get_u8()?;
21172 __struct.mission_type =
21173 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21174 enum_type: "MavMissionType",
21175 value: tmp as u64,
21176 })?;
21177 __struct.opaque_id = buf.get_u32_le()?;
21178 Ok(__struct)
21179 }
21180 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21181 let mut __tmp = BytesMut::new(bytes);
21182 #[allow(clippy::absurd_extreme_comparisons)]
21183 #[allow(unused_comparisons)]
21184 if __tmp.remaining() < Self::ENCODED_LEN {
21185 panic!(
21186 "buffer is too small (need {} bytes, but got {})",
21187 Self::ENCODED_LEN,
21188 __tmp.remaining(),
21189 )
21190 }
21191 __tmp.put_u16_le(self.count);
21192 __tmp.put_u8(self.target_system);
21193 __tmp.put_u8(self.target_component);
21194 if matches!(version, MavlinkVersion::V2) {
21195 __tmp.put_u8(self.mission_type as u8);
21196 __tmp.put_u32_le(self.opaque_id);
21197 let len = __tmp.len();
21198 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21199 } else {
21200 __tmp.len()
21201 }
21202 }
21203}
21204#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
21205#[doc = ""]
21206#[doc = "ID: 42"]
21207#[derive(Debug, Clone, PartialEq)]
21208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21209#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21210#[cfg_attr(feature = "ts", derive(TS))]
21211#[cfg_attr(feature = "ts", ts(export))]
21212pub struct MISSION_CURRENT_DATA {
21213 #[doc = "Sequence"]
21214 pub seq: u16,
21215 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
21216 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21217 pub total: u16,
21218 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
21219 #[cfg_attr(feature = "serde", serde(default))]
21220 pub mission_state: MissionState,
21221 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
21222 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21223 pub mission_mode: u8,
21224 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
21225 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21226 pub mission_id: u32,
21227 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
21228 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21229 pub fence_id: u32,
21230 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
21231 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21232 pub rally_points_id: u32,
21233}
21234impl MISSION_CURRENT_DATA {
21235 pub const ENCODED_LEN: usize = 18usize;
21236 pub const DEFAULT: Self = Self {
21237 seq: 0_u16,
21238 total: 0_u16,
21239 mission_state: MissionState::DEFAULT,
21240 mission_mode: 0_u8,
21241 mission_id: 0_u32,
21242 fence_id: 0_u32,
21243 rally_points_id: 0_u32,
21244 };
21245 #[cfg(feature = "arbitrary")]
21246 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21247 use arbitrary::{Arbitrary, Unstructured};
21248 let mut buf = [0u8; 1024];
21249 rng.fill_bytes(&mut buf);
21250 let mut unstructured = Unstructured::new(&buf);
21251 Self::arbitrary(&mut unstructured).unwrap_or_default()
21252 }
21253}
21254impl Default for MISSION_CURRENT_DATA {
21255 fn default() -> Self {
21256 Self::DEFAULT.clone()
21257 }
21258}
21259impl MessageData for MISSION_CURRENT_DATA {
21260 type Message = MavMessage;
21261 const ID: u32 = 42u32;
21262 const NAME: &'static str = "MISSION_CURRENT";
21263 const EXTRA_CRC: u8 = 28u8;
21264 const ENCODED_LEN: usize = 18usize;
21265 fn deser(
21266 _version: MavlinkVersion,
21267 __input: &[u8],
21268 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21269 let avail_len = __input.len();
21270 let mut payload_buf = [0; Self::ENCODED_LEN];
21271 let mut buf = if avail_len < Self::ENCODED_LEN {
21272 payload_buf[0..avail_len].copy_from_slice(__input);
21273 Bytes::new(&payload_buf)
21274 } else {
21275 Bytes::new(__input)
21276 };
21277 let mut __struct = Self::default();
21278 __struct.seq = buf.get_u16_le()?;
21279 __struct.total = buf.get_u16_le()?;
21280 let tmp = buf.get_u8()?;
21281 __struct.mission_state =
21282 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21283 enum_type: "MissionState",
21284 value: tmp as u64,
21285 })?;
21286 __struct.mission_mode = buf.get_u8()?;
21287 __struct.mission_id = buf.get_u32_le()?;
21288 __struct.fence_id = buf.get_u32_le()?;
21289 __struct.rally_points_id = buf.get_u32_le()?;
21290 Ok(__struct)
21291 }
21292 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21293 let mut __tmp = BytesMut::new(bytes);
21294 #[allow(clippy::absurd_extreme_comparisons)]
21295 #[allow(unused_comparisons)]
21296 if __tmp.remaining() < Self::ENCODED_LEN {
21297 panic!(
21298 "buffer is too small (need {} bytes, but got {})",
21299 Self::ENCODED_LEN,
21300 __tmp.remaining(),
21301 )
21302 }
21303 __tmp.put_u16_le(self.seq);
21304 if matches!(version, MavlinkVersion::V2) {
21305 __tmp.put_u16_le(self.total);
21306 __tmp.put_u8(self.mission_state as u8);
21307 __tmp.put_u8(self.mission_mode);
21308 __tmp.put_u32_le(self.mission_id);
21309 __tmp.put_u32_le(self.fence_id);
21310 __tmp.put_u32_le(self.rally_points_id);
21311 let len = __tmp.len();
21312 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21313 } else {
21314 __tmp.len()
21315 }
21316 }
21317}
21318#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
21319#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
21320#[doc = ""]
21321#[doc = "ID: 39"]
21322#[derive(Debug, Clone, PartialEq)]
21323#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21324#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21325#[cfg_attr(feature = "ts", derive(TS))]
21326#[cfg_attr(feature = "ts", ts(export))]
21327pub struct MISSION_ITEM_DATA {
21328 #[doc = "PARAM1, see MAV_CMD enum"]
21329 pub param1: f32,
21330 #[doc = "PARAM2, see MAV_CMD enum"]
21331 pub param2: f32,
21332 #[doc = "PARAM3, see MAV_CMD enum"]
21333 pub param3: f32,
21334 #[doc = "PARAM4, see MAV_CMD enum"]
21335 pub param4: f32,
21336 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
21337 pub x: f32,
21338 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
21339 pub y: f32,
21340 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
21341 pub z: f32,
21342 #[doc = "Sequence"]
21343 pub seq: u16,
21344 #[doc = "The scheduled action for the waypoint."]
21345 pub command: MavCmd,
21346 #[doc = "System ID"]
21347 pub target_system: u8,
21348 #[doc = "Component ID"]
21349 pub target_component: u8,
21350 #[doc = "The coordinate system of the waypoint."]
21351 pub frame: MavFrame,
21352 #[doc = "false:0, true:1"]
21353 pub current: u8,
21354 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
21355 pub autocontinue: u8,
21356 #[doc = "Mission type."]
21357 #[cfg_attr(feature = "serde", serde(default))]
21358 pub mission_type: MavMissionType,
21359}
21360impl MISSION_ITEM_DATA {
21361 pub const ENCODED_LEN: usize = 38usize;
21362 pub const DEFAULT: Self = Self {
21363 param1: 0.0_f32,
21364 param2: 0.0_f32,
21365 param3: 0.0_f32,
21366 param4: 0.0_f32,
21367 x: 0.0_f32,
21368 y: 0.0_f32,
21369 z: 0.0_f32,
21370 seq: 0_u16,
21371 command: MavCmd::DEFAULT,
21372 target_system: 0_u8,
21373 target_component: 0_u8,
21374 frame: MavFrame::DEFAULT,
21375 current: 0_u8,
21376 autocontinue: 0_u8,
21377 mission_type: MavMissionType::DEFAULT,
21378 };
21379 #[cfg(feature = "arbitrary")]
21380 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21381 use arbitrary::{Arbitrary, Unstructured};
21382 let mut buf = [0u8; 1024];
21383 rng.fill_bytes(&mut buf);
21384 let mut unstructured = Unstructured::new(&buf);
21385 Self::arbitrary(&mut unstructured).unwrap_or_default()
21386 }
21387}
21388impl Default for MISSION_ITEM_DATA {
21389 fn default() -> Self {
21390 Self::DEFAULT.clone()
21391 }
21392}
21393impl MessageData for MISSION_ITEM_DATA {
21394 type Message = MavMessage;
21395 const ID: u32 = 39u32;
21396 const NAME: &'static str = "MISSION_ITEM";
21397 const EXTRA_CRC: u8 = 254u8;
21398 const ENCODED_LEN: usize = 38usize;
21399 fn deser(
21400 _version: MavlinkVersion,
21401 __input: &[u8],
21402 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21403 let avail_len = __input.len();
21404 let mut payload_buf = [0; Self::ENCODED_LEN];
21405 let mut buf = if avail_len < Self::ENCODED_LEN {
21406 payload_buf[0..avail_len].copy_from_slice(__input);
21407 Bytes::new(&payload_buf)
21408 } else {
21409 Bytes::new(__input)
21410 };
21411 let mut __struct = Self::default();
21412 __struct.param1 = buf.get_f32_le()?;
21413 __struct.param2 = buf.get_f32_le()?;
21414 __struct.param3 = buf.get_f32_le()?;
21415 __struct.param4 = buf.get_f32_le()?;
21416 __struct.x = buf.get_f32_le()?;
21417 __struct.y = buf.get_f32_le()?;
21418 __struct.z = buf.get_f32_le()?;
21419 __struct.seq = buf.get_u16_le()?;
21420 let tmp = buf.get_u16_le()?;
21421 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
21422 ::mavlink_core::error::ParserError::InvalidEnum {
21423 enum_type: "MavCmd",
21424 value: tmp as u64,
21425 },
21426 )?;
21427 __struct.target_system = buf.get_u8()?;
21428 __struct.target_component = buf.get_u8()?;
21429 let tmp = buf.get_u8()?;
21430 __struct.frame =
21431 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21432 enum_type: "MavFrame",
21433 value: tmp as u64,
21434 })?;
21435 __struct.current = buf.get_u8()?;
21436 __struct.autocontinue = buf.get_u8()?;
21437 let tmp = buf.get_u8()?;
21438 __struct.mission_type =
21439 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21440 enum_type: "MavMissionType",
21441 value: tmp as u64,
21442 })?;
21443 Ok(__struct)
21444 }
21445 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21446 let mut __tmp = BytesMut::new(bytes);
21447 #[allow(clippy::absurd_extreme_comparisons)]
21448 #[allow(unused_comparisons)]
21449 if __tmp.remaining() < Self::ENCODED_LEN {
21450 panic!(
21451 "buffer is too small (need {} bytes, but got {})",
21452 Self::ENCODED_LEN,
21453 __tmp.remaining(),
21454 )
21455 }
21456 __tmp.put_f32_le(self.param1);
21457 __tmp.put_f32_le(self.param2);
21458 __tmp.put_f32_le(self.param3);
21459 __tmp.put_f32_le(self.param4);
21460 __tmp.put_f32_le(self.x);
21461 __tmp.put_f32_le(self.y);
21462 __tmp.put_f32_le(self.z);
21463 __tmp.put_u16_le(self.seq);
21464 __tmp.put_u16_le(self.command as u16);
21465 __tmp.put_u8(self.target_system);
21466 __tmp.put_u8(self.target_component);
21467 __tmp.put_u8(self.frame as u8);
21468 __tmp.put_u8(self.current);
21469 __tmp.put_u8(self.autocontinue);
21470 if matches!(version, MavlinkVersion::V2) {
21471 __tmp.put_u8(self.mission_type as u8);
21472 let len = __tmp.len();
21473 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21474 } else {
21475 __tmp.len()
21476 }
21477 }
21478}
21479#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
21480#[doc = ""]
21481#[doc = "ID: 73"]
21482#[derive(Debug, Clone, PartialEq)]
21483#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21484#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21485#[cfg_attr(feature = "ts", derive(TS))]
21486#[cfg_attr(feature = "ts", ts(export))]
21487pub struct MISSION_ITEM_INT_DATA {
21488 #[doc = "PARAM1, see MAV_CMD enum"]
21489 pub param1: f32,
21490 #[doc = "PARAM2, see MAV_CMD enum"]
21491 pub param2: f32,
21492 #[doc = "PARAM3, see MAV_CMD enum"]
21493 pub param3: f32,
21494 #[doc = "PARAM4, see MAV_CMD enum"]
21495 pub param4: f32,
21496 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
21497 pub x: i32,
21498 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
21499 pub y: i32,
21500 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
21501 pub z: f32,
21502 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
21503 pub seq: u16,
21504 #[doc = "The scheduled action for the waypoint."]
21505 pub command: MavCmd,
21506 #[doc = "System ID"]
21507 pub target_system: u8,
21508 #[doc = "Component ID"]
21509 pub target_component: u8,
21510 #[doc = "The coordinate system of the waypoint."]
21511 pub frame: MavFrame,
21512 #[doc = "false:0, true:1"]
21513 pub current: u8,
21514 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
21515 pub autocontinue: u8,
21516 #[doc = "Mission type."]
21517 #[cfg_attr(feature = "serde", serde(default))]
21518 pub mission_type: MavMissionType,
21519}
21520impl MISSION_ITEM_INT_DATA {
21521 pub const ENCODED_LEN: usize = 38usize;
21522 pub const DEFAULT: Self = Self {
21523 param1: 0.0_f32,
21524 param2: 0.0_f32,
21525 param3: 0.0_f32,
21526 param4: 0.0_f32,
21527 x: 0_i32,
21528 y: 0_i32,
21529 z: 0.0_f32,
21530 seq: 0_u16,
21531 command: MavCmd::DEFAULT,
21532 target_system: 0_u8,
21533 target_component: 0_u8,
21534 frame: MavFrame::DEFAULT,
21535 current: 0_u8,
21536 autocontinue: 0_u8,
21537 mission_type: MavMissionType::DEFAULT,
21538 };
21539 #[cfg(feature = "arbitrary")]
21540 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21541 use arbitrary::{Arbitrary, Unstructured};
21542 let mut buf = [0u8; 1024];
21543 rng.fill_bytes(&mut buf);
21544 let mut unstructured = Unstructured::new(&buf);
21545 Self::arbitrary(&mut unstructured).unwrap_or_default()
21546 }
21547}
21548impl Default for MISSION_ITEM_INT_DATA {
21549 fn default() -> Self {
21550 Self::DEFAULT.clone()
21551 }
21552}
21553impl MessageData for MISSION_ITEM_INT_DATA {
21554 type Message = MavMessage;
21555 const ID: u32 = 73u32;
21556 const NAME: &'static str = "MISSION_ITEM_INT";
21557 const EXTRA_CRC: u8 = 38u8;
21558 const ENCODED_LEN: usize = 38usize;
21559 fn deser(
21560 _version: MavlinkVersion,
21561 __input: &[u8],
21562 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21563 let avail_len = __input.len();
21564 let mut payload_buf = [0; Self::ENCODED_LEN];
21565 let mut buf = if avail_len < Self::ENCODED_LEN {
21566 payload_buf[0..avail_len].copy_from_slice(__input);
21567 Bytes::new(&payload_buf)
21568 } else {
21569 Bytes::new(__input)
21570 };
21571 let mut __struct = Self::default();
21572 __struct.param1 = buf.get_f32_le()?;
21573 __struct.param2 = buf.get_f32_le()?;
21574 __struct.param3 = buf.get_f32_le()?;
21575 __struct.param4 = buf.get_f32_le()?;
21576 __struct.x = buf.get_i32_le()?;
21577 __struct.y = buf.get_i32_le()?;
21578 __struct.z = buf.get_f32_le()?;
21579 __struct.seq = buf.get_u16_le()?;
21580 let tmp = buf.get_u16_le()?;
21581 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
21582 ::mavlink_core::error::ParserError::InvalidEnum {
21583 enum_type: "MavCmd",
21584 value: tmp as u64,
21585 },
21586 )?;
21587 __struct.target_system = buf.get_u8()?;
21588 __struct.target_component = buf.get_u8()?;
21589 let tmp = buf.get_u8()?;
21590 __struct.frame =
21591 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21592 enum_type: "MavFrame",
21593 value: tmp as u64,
21594 })?;
21595 __struct.current = buf.get_u8()?;
21596 __struct.autocontinue = buf.get_u8()?;
21597 let tmp = buf.get_u8()?;
21598 __struct.mission_type =
21599 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21600 enum_type: "MavMissionType",
21601 value: tmp as u64,
21602 })?;
21603 Ok(__struct)
21604 }
21605 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21606 let mut __tmp = BytesMut::new(bytes);
21607 #[allow(clippy::absurd_extreme_comparisons)]
21608 #[allow(unused_comparisons)]
21609 if __tmp.remaining() < Self::ENCODED_LEN {
21610 panic!(
21611 "buffer is too small (need {} bytes, but got {})",
21612 Self::ENCODED_LEN,
21613 __tmp.remaining(),
21614 )
21615 }
21616 __tmp.put_f32_le(self.param1);
21617 __tmp.put_f32_le(self.param2);
21618 __tmp.put_f32_le(self.param3);
21619 __tmp.put_f32_le(self.param4);
21620 __tmp.put_i32_le(self.x);
21621 __tmp.put_i32_le(self.y);
21622 __tmp.put_f32_le(self.z);
21623 __tmp.put_u16_le(self.seq);
21624 __tmp.put_u16_le(self.command as u16);
21625 __tmp.put_u8(self.target_system);
21626 __tmp.put_u8(self.target_component);
21627 __tmp.put_u8(self.frame as u8);
21628 __tmp.put_u8(self.current);
21629 __tmp.put_u8(self.autocontinue);
21630 if matches!(version, MavlinkVersion::V2) {
21631 __tmp.put_u8(self.mission_type as u8);
21632 let len = __tmp.len();
21633 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21634 } else {
21635 __tmp.len()
21636 }
21637 }
21638}
21639#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
21640#[doc = ""]
21641#[doc = "ID: 46"]
21642#[derive(Debug, Clone, PartialEq)]
21643#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21644#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21645#[cfg_attr(feature = "ts", derive(TS))]
21646#[cfg_attr(feature = "ts", ts(export))]
21647pub struct MISSION_ITEM_REACHED_DATA {
21648 #[doc = "Sequence"]
21649 pub seq: u16,
21650}
21651impl MISSION_ITEM_REACHED_DATA {
21652 pub const ENCODED_LEN: usize = 2usize;
21653 pub const DEFAULT: Self = Self { seq: 0_u16 };
21654 #[cfg(feature = "arbitrary")]
21655 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21656 use arbitrary::{Arbitrary, Unstructured};
21657 let mut buf = [0u8; 1024];
21658 rng.fill_bytes(&mut buf);
21659 let mut unstructured = Unstructured::new(&buf);
21660 Self::arbitrary(&mut unstructured).unwrap_or_default()
21661 }
21662}
21663impl Default for MISSION_ITEM_REACHED_DATA {
21664 fn default() -> Self {
21665 Self::DEFAULT.clone()
21666 }
21667}
21668impl MessageData for MISSION_ITEM_REACHED_DATA {
21669 type Message = MavMessage;
21670 const ID: u32 = 46u32;
21671 const NAME: &'static str = "MISSION_ITEM_REACHED";
21672 const EXTRA_CRC: u8 = 11u8;
21673 const ENCODED_LEN: usize = 2usize;
21674 fn deser(
21675 _version: MavlinkVersion,
21676 __input: &[u8],
21677 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21678 let avail_len = __input.len();
21679 let mut payload_buf = [0; Self::ENCODED_LEN];
21680 let mut buf = if avail_len < Self::ENCODED_LEN {
21681 payload_buf[0..avail_len].copy_from_slice(__input);
21682 Bytes::new(&payload_buf)
21683 } else {
21684 Bytes::new(__input)
21685 };
21686 let mut __struct = Self::default();
21687 __struct.seq = buf.get_u16_le()?;
21688 Ok(__struct)
21689 }
21690 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21691 let mut __tmp = BytesMut::new(bytes);
21692 #[allow(clippy::absurd_extreme_comparisons)]
21693 #[allow(unused_comparisons)]
21694 if __tmp.remaining() < Self::ENCODED_LEN {
21695 panic!(
21696 "buffer is too small (need {} bytes, but got {})",
21697 Self::ENCODED_LEN,
21698 __tmp.remaining(),
21699 )
21700 }
21701 __tmp.put_u16_le(self.seq);
21702 if matches!(version, MavlinkVersion::V2) {
21703 let len = __tmp.len();
21704 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21705 } else {
21706 __tmp.len()
21707 }
21708 }
21709}
21710#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
21711#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
21712#[doc = ""]
21713#[doc = "ID: 40"]
21714#[derive(Debug, Clone, PartialEq)]
21715#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21717#[cfg_attr(feature = "ts", derive(TS))]
21718#[cfg_attr(feature = "ts", ts(export))]
21719pub struct MISSION_REQUEST_DATA {
21720 #[doc = "Sequence"]
21721 pub seq: u16,
21722 #[doc = "System ID"]
21723 pub target_system: u8,
21724 #[doc = "Component ID"]
21725 pub target_component: u8,
21726 #[doc = "Mission type."]
21727 #[cfg_attr(feature = "serde", serde(default))]
21728 pub mission_type: MavMissionType,
21729}
21730impl MISSION_REQUEST_DATA {
21731 pub const ENCODED_LEN: usize = 5usize;
21732 pub const DEFAULT: Self = Self {
21733 seq: 0_u16,
21734 target_system: 0_u8,
21735 target_component: 0_u8,
21736 mission_type: MavMissionType::DEFAULT,
21737 };
21738 #[cfg(feature = "arbitrary")]
21739 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21740 use arbitrary::{Arbitrary, Unstructured};
21741 let mut buf = [0u8; 1024];
21742 rng.fill_bytes(&mut buf);
21743 let mut unstructured = Unstructured::new(&buf);
21744 Self::arbitrary(&mut unstructured).unwrap_or_default()
21745 }
21746}
21747impl Default for MISSION_REQUEST_DATA {
21748 fn default() -> Self {
21749 Self::DEFAULT.clone()
21750 }
21751}
21752impl MessageData for MISSION_REQUEST_DATA {
21753 type Message = MavMessage;
21754 const ID: u32 = 40u32;
21755 const NAME: &'static str = "MISSION_REQUEST";
21756 const EXTRA_CRC: u8 = 230u8;
21757 const ENCODED_LEN: usize = 5usize;
21758 fn deser(
21759 _version: MavlinkVersion,
21760 __input: &[u8],
21761 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21762 let avail_len = __input.len();
21763 let mut payload_buf = [0; Self::ENCODED_LEN];
21764 let mut buf = if avail_len < Self::ENCODED_LEN {
21765 payload_buf[0..avail_len].copy_from_slice(__input);
21766 Bytes::new(&payload_buf)
21767 } else {
21768 Bytes::new(__input)
21769 };
21770 let mut __struct = Self::default();
21771 __struct.seq = buf.get_u16_le()?;
21772 __struct.target_system = buf.get_u8()?;
21773 __struct.target_component = buf.get_u8()?;
21774 let tmp = buf.get_u8()?;
21775 __struct.mission_type =
21776 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21777 enum_type: "MavMissionType",
21778 value: tmp as u64,
21779 })?;
21780 Ok(__struct)
21781 }
21782 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21783 let mut __tmp = BytesMut::new(bytes);
21784 #[allow(clippy::absurd_extreme_comparisons)]
21785 #[allow(unused_comparisons)]
21786 if __tmp.remaining() < Self::ENCODED_LEN {
21787 panic!(
21788 "buffer is too small (need {} bytes, but got {})",
21789 Self::ENCODED_LEN,
21790 __tmp.remaining(),
21791 )
21792 }
21793 __tmp.put_u16_le(self.seq);
21794 __tmp.put_u8(self.target_system);
21795 __tmp.put_u8(self.target_component);
21796 if matches!(version, MavlinkVersion::V2) {
21797 __tmp.put_u8(self.mission_type as u8);
21798 let len = __tmp.len();
21799 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21800 } else {
21801 __tmp.len()
21802 }
21803 }
21804}
21805#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
21806#[doc = ""]
21807#[doc = "ID: 51"]
21808#[derive(Debug, Clone, PartialEq)]
21809#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21810#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21811#[cfg_attr(feature = "ts", derive(TS))]
21812#[cfg_attr(feature = "ts", ts(export))]
21813pub struct MISSION_REQUEST_INT_DATA {
21814 #[doc = "Sequence"]
21815 pub seq: u16,
21816 #[doc = "System ID"]
21817 pub target_system: u8,
21818 #[doc = "Component ID"]
21819 pub target_component: u8,
21820 #[doc = "Mission type."]
21821 #[cfg_attr(feature = "serde", serde(default))]
21822 pub mission_type: MavMissionType,
21823}
21824impl MISSION_REQUEST_INT_DATA {
21825 pub const ENCODED_LEN: usize = 5usize;
21826 pub const DEFAULT: Self = Self {
21827 seq: 0_u16,
21828 target_system: 0_u8,
21829 target_component: 0_u8,
21830 mission_type: MavMissionType::DEFAULT,
21831 };
21832 #[cfg(feature = "arbitrary")]
21833 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21834 use arbitrary::{Arbitrary, Unstructured};
21835 let mut buf = [0u8; 1024];
21836 rng.fill_bytes(&mut buf);
21837 let mut unstructured = Unstructured::new(&buf);
21838 Self::arbitrary(&mut unstructured).unwrap_or_default()
21839 }
21840}
21841impl Default for MISSION_REQUEST_INT_DATA {
21842 fn default() -> Self {
21843 Self::DEFAULT.clone()
21844 }
21845}
21846impl MessageData for MISSION_REQUEST_INT_DATA {
21847 type Message = MavMessage;
21848 const ID: u32 = 51u32;
21849 const NAME: &'static str = "MISSION_REQUEST_INT";
21850 const EXTRA_CRC: u8 = 196u8;
21851 const ENCODED_LEN: usize = 5usize;
21852 fn deser(
21853 _version: MavlinkVersion,
21854 __input: &[u8],
21855 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21856 let avail_len = __input.len();
21857 let mut payload_buf = [0; Self::ENCODED_LEN];
21858 let mut buf = if avail_len < Self::ENCODED_LEN {
21859 payload_buf[0..avail_len].copy_from_slice(__input);
21860 Bytes::new(&payload_buf)
21861 } else {
21862 Bytes::new(__input)
21863 };
21864 let mut __struct = Self::default();
21865 __struct.seq = buf.get_u16_le()?;
21866 __struct.target_system = buf.get_u8()?;
21867 __struct.target_component = buf.get_u8()?;
21868 let tmp = buf.get_u8()?;
21869 __struct.mission_type =
21870 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21871 enum_type: "MavMissionType",
21872 value: tmp as u64,
21873 })?;
21874 Ok(__struct)
21875 }
21876 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21877 let mut __tmp = BytesMut::new(bytes);
21878 #[allow(clippy::absurd_extreme_comparisons)]
21879 #[allow(unused_comparisons)]
21880 if __tmp.remaining() < Self::ENCODED_LEN {
21881 panic!(
21882 "buffer is too small (need {} bytes, but got {})",
21883 Self::ENCODED_LEN,
21884 __tmp.remaining(),
21885 )
21886 }
21887 __tmp.put_u16_le(self.seq);
21888 __tmp.put_u8(self.target_system);
21889 __tmp.put_u8(self.target_component);
21890 if matches!(version, MavlinkVersion::V2) {
21891 __tmp.put_u8(self.mission_type as u8);
21892 let len = __tmp.len();
21893 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21894 } else {
21895 __tmp.len()
21896 }
21897 }
21898}
21899#[doc = "Request the overall list of mission items from the system/component."]
21900#[doc = ""]
21901#[doc = "ID: 43"]
21902#[derive(Debug, Clone, PartialEq)]
21903#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21904#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21905#[cfg_attr(feature = "ts", derive(TS))]
21906#[cfg_attr(feature = "ts", ts(export))]
21907pub struct MISSION_REQUEST_LIST_DATA {
21908 #[doc = "System ID"]
21909 pub target_system: u8,
21910 #[doc = "Component ID"]
21911 pub target_component: u8,
21912 #[doc = "Mission type."]
21913 #[cfg_attr(feature = "serde", serde(default))]
21914 pub mission_type: MavMissionType,
21915}
21916impl MISSION_REQUEST_LIST_DATA {
21917 pub const ENCODED_LEN: usize = 3usize;
21918 pub const DEFAULT: Self = Self {
21919 target_system: 0_u8,
21920 target_component: 0_u8,
21921 mission_type: MavMissionType::DEFAULT,
21922 };
21923 #[cfg(feature = "arbitrary")]
21924 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21925 use arbitrary::{Arbitrary, Unstructured};
21926 let mut buf = [0u8; 1024];
21927 rng.fill_bytes(&mut buf);
21928 let mut unstructured = Unstructured::new(&buf);
21929 Self::arbitrary(&mut unstructured).unwrap_or_default()
21930 }
21931}
21932impl Default for MISSION_REQUEST_LIST_DATA {
21933 fn default() -> Self {
21934 Self::DEFAULT.clone()
21935 }
21936}
21937impl MessageData for MISSION_REQUEST_LIST_DATA {
21938 type Message = MavMessage;
21939 const ID: u32 = 43u32;
21940 const NAME: &'static str = "MISSION_REQUEST_LIST";
21941 const EXTRA_CRC: u8 = 132u8;
21942 const ENCODED_LEN: usize = 3usize;
21943 fn deser(
21944 _version: MavlinkVersion,
21945 __input: &[u8],
21946 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21947 let avail_len = __input.len();
21948 let mut payload_buf = [0; Self::ENCODED_LEN];
21949 let mut buf = if avail_len < Self::ENCODED_LEN {
21950 payload_buf[0..avail_len].copy_from_slice(__input);
21951 Bytes::new(&payload_buf)
21952 } else {
21953 Bytes::new(__input)
21954 };
21955 let mut __struct = Self::default();
21956 __struct.target_system = buf.get_u8()?;
21957 __struct.target_component = buf.get_u8()?;
21958 let tmp = buf.get_u8()?;
21959 __struct.mission_type =
21960 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21961 enum_type: "MavMissionType",
21962 value: tmp as u64,
21963 })?;
21964 Ok(__struct)
21965 }
21966 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21967 let mut __tmp = BytesMut::new(bytes);
21968 #[allow(clippy::absurd_extreme_comparisons)]
21969 #[allow(unused_comparisons)]
21970 if __tmp.remaining() < Self::ENCODED_LEN {
21971 panic!(
21972 "buffer is too small (need {} bytes, but got {})",
21973 Self::ENCODED_LEN,
21974 __tmp.remaining(),
21975 )
21976 }
21977 __tmp.put_u8(self.target_system);
21978 __tmp.put_u8(self.target_component);
21979 if matches!(version, MavlinkVersion::V2) {
21980 __tmp.put_u8(self.mission_type as u8);
21981 let len = __tmp.len();
21982 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21983 } else {
21984 __tmp.len()
21985 }
21986 }
21987}
21988#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
21989#[doc = ""]
21990#[doc = "ID: 37"]
21991#[derive(Debug, Clone, PartialEq)]
21992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21993#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21994#[cfg_attr(feature = "ts", derive(TS))]
21995#[cfg_attr(feature = "ts", ts(export))]
21996pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
21997 #[doc = "Start index"]
21998 pub start_index: i16,
21999 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
22000 pub end_index: i16,
22001 #[doc = "System ID"]
22002 pub target_system: u8,
22003 #[doc = "Component ID"]
22004 pub target_component: u8,
22005 #[doc = "Mission type."]
22006 #[cfg_attr(feature = "serde", serde(default))]
22007 pub mission_type: MavMissionType,
22008}
22009impl MISSION_REQUEST_PARTIAL_LIST_DATA {
22010 pub const ENCODED_LEN: usize = 7usize;
22011 pub const DEFAULT: Self = Self {
22012 start_index: 0_i16,
22013 end_index: 0_i16,
22014 target_system: 0_u8,
22015 target_component: 0_u8,
22016 mission_type: MavMissionType::DEFAULT,
22017 };
22018 #[cfg(feature = "arbitrary")]
22019 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22020 use arbitrary::{Arbitrary, Unstructured};
22021 let mut buf = [0u8; 1024];
22022 rng.fill_bytes(&mut buf);
22023 let mut unstructured = Unstructured::new(&buf);
22024 Self::arbitrary(&mut unstructured).unwrap_or_default()
22025 }
22026}
22027impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
22028 fn default() -> Self {
22029 Self::DEFAULT.clone()
22030 }
22031}
22032impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
22033 type Message = MavMessage;
22034 const ID: u32 = 37u32;
22035 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
22036 const EXTRA_CRC: u8 = 212u8;
22037 const ENCODED_LEN: usize = 7usize;
22038 fn deser(
22039 _version: MavlinkVersion,
22040 __input: &[u8],
22041 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22042 let avail_len = __input.len();
22043 let mut payload_buf = [0; Self::ENCODED_LEN];
22044 let mut buf = if avail_len < Self::ENCODED_LEN {
22045 payload_buf[0..avail_len].copy_from_slice(__input);
22046 Bytes::new(&payload_buf)
22047 } else {
22048 Bytes::new(__input)
22049 };
22050 let mut __struct = Self::default();
22051 __struct.start_index = buf.get_i16_le()?;
22052 __struct.end_index = buf.get_i16_le()?;
22053 __struct.target_system = buf.get_u8()?;
22054 __struct.target_component = buf.get_u8()?;
22055 let tmp = buf.get_u8()?;
22056 __struct.mission_type =
22057 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22058 enum_type: "MavMissionType",
22059 value: tmp as u64,
22060 })?;
22061 Ok(__struct)
22062 }
22063 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22064 let mut __tmp = BytesMut::new(bytes);
22065 #[allow(clippy::absurd_extreme_comparisons)]
22066 #[allow(unused_comparisons)]
22067 if __tmp.remaining() < Self::ENCODED_LEN {
22068 panic!(
22069 "buffer is too small (need {} bytes, but got {})",
22070 Self::ENCODED_LEN,
22071 __tmp.remaining(),
22072 )
22073 }
22074 __tmp.put_i16_le(self.start_index);
22075 __tmp.put_i16_le(self.end_index);
22076 __tmp.put_u8(self.target_system);
22077 __tmp.put_u8(self.target_component);
22078 if matches!(version, MavlinkVersion::V2) {
22079 __tmp.put_u8(self.mission_type as u8);
22080 let len = __tmp.len();
22081 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22082 } else {
22083 __tmp.len()
22084 }
22085 }
22086}
22087#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
22088#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
22089#[doc = ""]
22090#[doc = "ID: 41"]
22091#[derive(Debug, Clone, PartialEq)]
22092#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22093#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22094#[cfg_attr(feature = "ts", derive(TS))]
22095#[cfg_attr(feature = "ts", ts(export))]
22096pub struct MISSION_SET_CURRENT_DATA {
22097 #[doc = "Sequence"]
22098 pub seq: u16,
22099 #[doc = "System ID"]
22100 pub target_system: u8,
22101 #[doc = "Component ID"]
22102 pub target_component: u8,
22103}
22104impl MISSION_SET_CURRENT_DATA {
22105 pub const ENCODED_LEN: usize = 4usize;
22106 pub const DEFAULT: Self = Self {
22107 seq: 0_u16,
22108 target_system: 0_u8,
22109 target_component: 0_u8,
22110 };
22111 #[cfg(feature = "arbitrary")]
22112 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22113 use arbitrary::{Arbitrary, Unstructured};
22114 let mut buf = [0u8; 1024];
22115 rng.fill_bytes(&mut buf);
22116 let mut unstructured = Unstructured::new(&buf);
22117 Self::arbitrary(&mut unstructured).unwrap_or_default()
22118 }
22119}
22120impl Default for MISSION_SET_CURRENT_DATA {
22121 fn default() -> Self {
22122 Self::DEFAULT.clone()
22123 }
22124}
22125impl MessageData for MISSION_SET_CURRENT_DATA {
22126 type Message = MavMessage;
22127 const ID: u32 = 41u32;
22128 const NAME: &'static str = "MISSION_SET_CURRENT";
22129 const EXTRA_CRC: u8 = 28u8;
22130 const ENCODED_LEN: usize = 4usize;
22131 fn deser(
22132 _version: MavlinkVersion,
22133 __input: &[u8],
22134 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22135 let avail_len = __input.len();
22136 let mut payload_buf = [0; Self::ENCODED_LEN];
22137 let mut buf = if avail_len < Self::ENCODED_LEN {
22138 payload_buf[0..avail_len].copy_from_slice(__input);
22139 Bytes::new(&payload_buf)
22140 } else {
22141 Bytes::new(__input)
22142 };
22143 let mut __struct = Self::default();
22144 __struct.seq = buf.get_u16_le()?;
22145 __struct.target_system = buf.get_u8()?;
22146 __struct.target_component = buf.get_u8()?;
22147 Ok(__struct)
22148 }
22149 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22150 let mut __tmp = BytesMut::new(bytes);
22151 #[allow(clippy::absurd_extreme_comparisons)]
22152 #[allow(unused_comparisons)]
22153 if __tmp.remaining() < Self::ENCODED_LEN {
22154 panic!(
22155 "buffer is too small (need {} bytes, but got {})",
22156 Self::ENCODED_LEN,
22157 __tmp.remaining(),
22158 )
22159 }
22160 __tmp.put_u16_le(self.seq);
22161 __tmp.put_u8(self.target_system);
22162 __tmp.put_u8(self.target_component);
22163 if matches!(version, MavlinkVersion::V2) {
22164 let len = __tmp.len();
22165 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22166 } else {
22167 __tmp.len()
22168 }
22169 }
22170}
22171#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
22172#[doc = ""]
22173#[doc = "ID: 38"]
22174#[derive(Debug, Clone, PartialEq)]
22175#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22176#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22177#[cfg_attr(feature = "ts", derive(TS))]
22178#[cfg_attr(feature = "ts", ts(export))]
22179pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
22180 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
22181 pub start_index: i16,
22182 #[doc = "End index, equal or greater than start index."]
22183 pub end_index: i16,
22184 #[doc = "System ID"]
22185 pub target_system: u8,
22186 #[doc = "Component ID"]
22187 pub target_component: u8,
22188 #[doc = "Mission type."]
22189 #[cfg_attr(feature = "serde", serde(default))]
22190 pub mission_type: MavMissionType,
22191}
22192impl MISSION_WRITE_PARTIAL_LIST_DATA {
22193 pub const ENCODED_LEN: usize = 7usize;
22194 pub const DEFAULT: Self = Self {
22195 start_index: 0_i16,
22196 end_index: 0_i16,
22197 target_system: 0_u8,
22198 target_component: 0_u8,
22199 mission_type: MavMissionType::DEFAULT,
22200 };
22201 #[cfg(feature = "arbitrary")]
22202 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22203 use arbitrary::{Arbitrary, Unstructured};
22204 let mut buf = [0u8; 1024];
22205 rng.fill_bytes(&mut buf);
22206 let mut unstructured = Unstructured::new(&buf);
22207 Self::arbitrary(&mut unstructured).unwrap_or_default()
22208 }
22209}
22210impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
22211 fn default() -> Self {
22212 Self::DEFAULT.clone()
22213 }
22214}
22215impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
22216 type Message = MavMessage;
22217 const ID: u32 = 38u32;
22218 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
22219 const EXTRA_CRC: u8 = 9u8;
22220 const ENCODED_LEN: usize = 7usize;
22221 fn deser(
22222 _version: MavlinkVersion,
22223 __input: &[u8],
22224 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22225 let avail_len = __input.len();
22226 let mut payload_buf = [0; Self::ENCODED_LEN];
22227 let mut buf = if avail_len < Self::ENCODED_LEN {
22228 payload_buf[0..avail_len].copy_from_slice(__input);
22229 Bytes::new(&payload_buf)
22230 } else {
22231 Bytes::new(__input)
22232 };
22233 let mut __struct = Self::default();
22234 __struct.start_index = buf.get_i16_le()?;
22235 __struct.end_index = buf.get_i16_le()?;
22236 __struct.target_system = buf.get_u8()?;
22237 __struct.target_component = buf.get_u8()?;
22238 let tmp = buf.get_u8()?;
22239 __struct.mission_type =
22240 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22241 enum_type: "MavMissionType",
22242 value: tmp as u64,
22243 })?;
22244 Ok(__struct)
22245 }
22246 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22247 let mut __tmp = BytesMut::new(bytes);
22248 #[allow(clippy::absurd_extreme_comparisons)]
22249 #[allow(unused_comparisons)]
22250 if __tmp.remaining() < Self::ENCODED_LEN {
22251 panic!(
22252 "buffer is too small (need {} bytes, but got {})",
22253 Self::ENCODED_LEN,
22254 __tmp.remaining(),
22255 )
22256 }
22257 __tmp.put_i16_le(self.start_index);
22258 __tmp.put_i16_le(self.end_index);
22259 __tmp.put_u8(self.target_system);
22260 __tmp.put_u8(self.target_component);
22261 if matches!(version, MavlinkVersion::V2) {
22262 __tmp.put_u8(self.mission_type as u8);
22263 let len = __tmp.len();
22264 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22265 } else {
22266 __tmp.len()
22267 }
22268 }
22269}
22270#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
22271#[doc = "Orientation of a mount."]
22272#[doc = ""]
22273#[doc = "ID: 265"]
22274#[derive(Debug, Clone, PartialEq)]
22275#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22276#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22277#[cfg_attr(feature = "ts", derive(TS))]
22278#[cfg_attr(feature = "ts", ts(export))]
22279pub struct MOUNT_ORIENTATION_DATA {
22280 #[doc = "Timestamp (time since system boot)."]
22281 pub time_boot_ms: u32,
22282 #[doc = "Roll in global frame (set to NaN for invalid)."]
22283 pub roll: f32,
22284 #[doc = "Pitch in global frame (set to NaN for invalid)."]
22285 pub pitch: f32,
22286 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
22287 pub yaw: f32,
22288 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
22289 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22290 pub yaw_absolute: f32,
22291}
22292impl MOUNT_ORIENTATION_DATA {
22293 pub const ENCODED_LEN: usize = 20usize;
22294 pub const DEFAULT: Self = Self {
22295 time_boot_ms: 0_u32,
22296 roll: 0.0_f32,
22297 pitch: 0.0_f32,
22298 yaw: 0.0_f32,
22299 yaw_absolute: 0.0_f32,
22300 };
22301 #[cfg(feature = "arbitrary")]
22302 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22303 use arbitrary::{Arbitrary, Unstructured};
22304 let mut buf = [0u8; 1024];
22305 rng.fill_bytes(&mut buf);
22306 let mut unstructured = Unstructured::new(&buf);
22307 Self::arbitrary(&mut unstructured).unwrap_or_default()
22308 }
22309}
22310impl Default for MOUNT_ORIENTATION_DATA {
22311 fn default() -> Self {
22312 Self::DEFAULT.clone()
22313 }
22314}
22315impl MessageData for MOUNT_ORIENTATION_DATA {
22316 type Message = MavMessage;
22317 const ID: u32 = 265u32;
22318 const NAME: &'static str = "MOUNT_ORIENTATION";
22319 const EXTRA_CRC: u8 = 26u8;
22320 const ENCODED_LEN: usize = 20usize;
22321 fn deser(
22322 _version: MavlinkVersion,
22323 __input: &[u8],
22324 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22325 let avail_len = __input.len();
22326 let mut payload_buf = [0; Self::ENCODED_LEN];
22327 let mut buf = if avail_len < Self::ENCODED_LEN {
22328 payload_buf[0..avail_len].copy_from_slice(__input);
22329 Bytes::new(&payload_buf)
22330 } else {
22331 Bytes::new(__input)
22332 };
22333 let mut __struct = Self::default();
22334 __struct.time_boot_ms = buf.get_u32_le()?;
22335 __struct.roll = buf.get_f32_le()?;
22336 __struct.pitch = buf.get_f32_le()?;
22337 __struct.yaw = buf.get_f32_le()?;
22338 __struct.yaw_absolute = buf.get_f32_le()?;
22339 Ok(__struct)
22340 }
22341 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22342 let mut __tmp = BytesMut::new(bytes);
22343 #[allow(clippy::absurd_extreme_comparisons)]
22344 #[allow(unused_comparisons)]
22345 if __tmp.remaining() < Self::ENCODED_LEN {
22346 panic!(
22347 "buffer is too small (need {} bytes, but got {})",
22348 Self::ENCODED_LEN,
22349 __tmp.remaining(),
22350 )
22351 }
22352 __tmp.put_u32_le(self.time_boot_ms);
22353 __tmp.put_f32_le(self.roll);
22354 __tmp.put_f32_le(self.pitch);
22355 __tmp.put_f32_le(self.yaw);
22356 if matches!(version, MavlinkVersion::V2) {
22357 __tmp.put_f32_le(self.yaw_absolute);
22358 let len = __tmp.len();
22359 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22360 } else {
22361 __tmp.len()
22362 }
22363 }
22364}
22365#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
22366#[doc = ""]
22367#[doc = "ID: 251"]
22368#[derive(Debug, Clone, PartialEq)]
22369#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22370#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22371#[cfg_attr(feature = "ts", derive(TS))]
22372#[cfg_attr(feature = "ts", ts(export))]
22373pub struct NAMED_VALUE_FLOAT_DATA {
22374 #[doc = "Timestamp (time since system boot)."]
22375 pub time_boot_ms: u32,
22376 #[doc = "Floating point value"]
22377 pub value: f32,
22378 #[doc = "Name of the debug variable"]
22379 #[cfg_attr(feature = "ts", ts(type = "string"))]
22380 pub name: CharArray<10>,
22381}
22382impl NAMED_VALUE_FLOAT_DATA {
22383 pub const ENCODED_LEN: usize = 18usize;
22384 pub const DEFAULT: Self = Self {
22385 time_boot_ms: 0_u32,
22386 value: 0.0_f32,
22387 name: CharArray::new([0_u8; 10usize]),
22388 };
22389 #[cfg(feature = "arbitrary")]
22390 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22391 use arbitrary::{Arbitrary, Unstructured};
22392 let mut buf = [0u8; 1024];
22393 rng.fill_bytes(&mut buf);
22394 let mut unstructured = Unstructured::new(&buf);
22395 Self::arbitrary(&mut unstructured).unwrap_or_default()
22396 }
22397}
22398impl Default for NAMED_VALUE_FLOAT_DATA {
22399 fn default() -> Self {
22400 Self::DEFAULT.clone()
22401 }
22402}
22403impl MessageData for NAMED_VALUE_FLOAT_DATA {
22404 type Message = MavMessage;
22405 const ID: u32 = 251u32;
22406 const NAME: &'static str = "NAMED_VALUE_FLOAT";
22407 const EXTRA_CRC: u8 = 170u8;
22408 const ENCODED_LEN: usize = 18usize;
22409 fn deser(
22410 _version: MavlinkVersion,
22411 __input: &[u8],
22412 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22413 let avail_len = __input.len();
22414 let mut payload_buf = [0; Self::ENCODED_LEN];
22415 let mut buf = if avail_len < Self::ENCODED_LEN {
22416 payload_buf[0..avail_len].copy_from_slice(__input);
22417 Bytes::new(&payload_buf)
22418 } else {
22419 Bytes::new(__input)
22420 };
22421 let mut __struct = Self::default();
22422 __struct.time_boot_ms = buf.get_u32_le()?;
22423 __struct.value = buf.get_f32_le()?;
22424 let mut tmp = [0_u8; 10usize];
22425 for v in &mut tmp {
22426 *v = buf.get_u8()?;
22427 }
22428 __struct.name = CharArray::new(tmp);
22429 Ok(__struct)
22430 }
22431 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22432 let mut __tmp = BytesMut::new(bytes);
22433 #[allow(clippy::absurd_extreme_comparisons)]
22434 #[allow(unused_comparisons)]
22435 if __tmp.remaining() < Self::ENCODED_LEN {
22436 panic!(
22437 "buffer is too small (need {} bytes, but got {})",
22438 Self::ENCODED_LEN,
22439 __tmp.remaining(),
22440 )
22441 }
22442 __tmp.put_u32_le(self.time_boot_ms);
22443 __tmp.put_f32_le(self.value);
22444 for val in &self.name {
22445 __tmp.put_u8(*val);
22446 }
22447 if matches!(version, MavlinkVersion::V2) {
22448 let len = __tmp.len();
22449 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22450 } else {
22451 __tmp.len()
22452 }
22453 }
22454}
22455#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
22456#[doc = ""]
22457#[doc = "ID: 252"]
22458#[derive(Debug, Clone, PartialEq)]
22459#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22460#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22461#[cfg_attr(feature = "ts", derive(TS))]
22462#[cfg_attr(feature = "ts", ts(export))]
22463pub struct NAMED_VALUE_INT_DATA {
22464 #[doc = "Timestamp (time since system boot)."]
22465 pub time_boot_ms: u32,
22466 #[doc = "Signed integer value"]
22467 pub value: i32,
22468 #[doc = "Name of the debug variable"]
22469 #[cfg_attr(feature = "ts", ts(type = "string"))]
22470 pub name: CharArray<10>,
22471}
22472impl NAMED_VALUE_INT_DATA {
22473 pub const ENCODED_LEN: usize = 18usize;
22474 pub const DEFAULT: Self = Self {
22475 time_boot_ms: 0_u32,
22476 value: 0_i32,
22477 name: CharArray::new([0_u8; 10usize]),
22478 };
22479 #[cfg(feature = "arbitrary")]
22480 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22481 use arbitrary::{Arbitrary, Unstructured};
22482 let mut buf = [0u8; 1024];
22483 rng.fill_bytes(&mut buf);
22484 let mut unstructured = Unstructured::new(&buf);
22485 Self::arbitrary(&mut unstructured).unwrap_or_default()
22486 }
22487}
22488impl Default for NAMED_VALUE_INT_DATA {
22489 fn default() -> Self {
22490 Self::DEFAULT.clone()
22491 }
22492}
22493impl MessageData for NAMED_VALUE_INT_DATA {
22494 type Message = MavMessage;
22495 const ID: u32 = 252u32;
22496 const NAME: &'static str = "NAMED_VALUE_INT";
22497 const EXTRA_CRC: u8 = 44u8;
22498 const ENCODED_LEN: usize = 18usize;
22499 fn deser(
22500 _version: MavlinkVersion,
22501 __input: &[u8],
22502 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22503 let avail_len = __input.len();
22504 let mut payload_buf = [0; Self::ENCODED_LEN];
22505 let mut buf = if avail_len < Self::ENCODED_LEN {
22506 payload_buf[0..avail_len].copy_from_slice(__input);
22507 Bytes::new(&payload_buf)
22508 } else {
22509 Bytes::new(__input)
22510 };
22511 let mut __struct = Self::default();
22512 __struct.time_boot_ms = buf.get_u32_le()?;
22513 __struct.value = buf.get_i32_le()?;
22514 let mut tmp = [0_u8; 10usize];
22515 for v in &mut tmp {
22516 *v = buf.get_u8()?;
22517 }
22518 __struct.name = CharArray::new(tmp);
22519 Ok(__struct)
22520 }
22521 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22522 let mut __tmp = BytesMut::new(bytes);
22523 #[allow(clippy::absurd_extreme_comparisons)]
22524 #[allow(unused_comparisons)]
22525 if __tmp.remaining() < Self::ENCODED_LEN {
22526 panic!(
22527 "buffer is too small (need {} bytes, but got {})",
22528 Self::ENCODED_LEN,
22529 __tmp.remaining(),
22530 )
22531 }
22532 __tmp.put_u32_le(self.time_boot_ms);
22533 __tmp.put_i32_le(self.value);
22534 for val in &self.name {
22535 __tmp.put_u8(*val);
22536 }
22537 if matches!(version, MavlinkVersion::V2) {
22538 let len = __tmp.len();
22539 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22540 } else {
22541 __tmp.len()
22542 }
22543 }
22544}
22545#[doc = "The state of the navigation and position controller."]
22546#[doc = ""]
22547#[doc = "ID: 62"]
22548#[derive(Debug, Clone, PartialEq)]
22549#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22550#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22551#[cfg_attr(feature = "ts", derive(TS))]
22552#[cfg_attr(feature = "ts", ts(export))]
22553pub struct NAV_CONTROLLER_OUTPUT_DATA {
22554 #[doc = "Current desired roll"]
22555 pub nav_roll: f32,
22556 #[doc = "Current desired pitch"]
22557 pub nav_pitch: f32,
22558 #[doc = "Current altitude error"]
22559 pub alt_error: f32,
22560 #[doc = "Current airspeed error"]
22561 pub aspd_error: f32,
22562 #[doc = "Current crosstrack error on x-y plane"]
22563 pub xtrack_error: f32,
22564 #[doc = "Current desired heading"]
22565 pub nav_bearing: i16,
22566 #[doc = "Bearing to current waypoint/target"]
22567 pub target_bearing: i16,
22568 #[doc = "Distance to active waypoint"]
22569 pub wp_dist: u16,
22570}
22571impl NAV_CONTROLLER_OUTPUT_DATA {
22572 pub const ENCODED_LEN: usize = 26usize;
22573 pub const DEFAULT: Self = Self {
22574 nav_roll: 0.0_f32,
22575 nav_pitch: 0.0_f32,
22576 alt_error: 0.0_f32,
22577 aspd_error: 0.0_f32,
22578 xtrack_error: 0.0_f32,
22579 nav_bearing: 0_i16,
22580 target_bearing: 0_i16,
22581 wp_dist: 0_u16,
22582 };
22583 #[cfg(feature = "arbitrary")]
22584 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22585 use arbitrary::{Arbitrary, Unstructured};
22586 let mut buf = [0u8; 1024];
22587 rng.fill_bytes(&mut buf);
22588 let mut unstructured = Unstructured::new(&buf);
22589 Self::arbitrary(&mut unstructured).unwrap_or_default()
22590 }
22591}
22592impl Default for NAV_CONTROLLER_OUTPUT_DATA {
22593 fn default() -> Self {
22594 Self::DEFAULT.clone()
22595 }
22596}
22597impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
22598 type Message = MavMessage;
22599 const ID: u32 = 62u32;
22600 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
22601 const EXTRA_CRC: u8 = 183u8;
22602 const ENCODED_LEN: usize = 26usize;
22603 fn deser(
22604 _version: MavlinkVersion,
22605 __input: &[u8],
22606 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22607 let avail_len = __input.len();
22608 let mut payload_buf = [0; Self::ENCODED_LEN];
22609 let mut buf = if avail_len < Self::ENCODED_LEN {
22610 payload_buf[0..avail_len].copy_from_slice(__input);
22611 Bytes::new(&payload_buf)
22612 } else {
22613 Bytes::new(__input)
22614 };
22615 let mut __struct = Self::default();
22616 __struct.nav_roll = buf.get_f32_le()?;
22617 __struct.nav_pitch = buf.get_f32_le()?;
22618 __struct.alt_error = buf.get_f32_le()?;
22619 __struct.aspd_error = buf.get_f32_le()?;
22620 __struct.xtrack_error = buf.get_f32_le()?;
22621 __struct.nav_bearing = buf.get_i16_le()?;
22622 __struct.target_bearing = buf.get_i16_le()?;
22623 __struct.wp_dist = buf.get_u16_le()?;
22624 Ok(__struct)
22625 }
22626 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22627 let mut __tmp = BytesMut::new(bytes);
22628 #[allow(clippy::absurd_extreme_comparisons)]
22629 #[allow(unused_comparisons)]
22630 if __tmp.remaining() < Self::ENCODED_LEN {
22631 panic!(
22632 "buffer is too small (need {} bytes, but got {})",
22633 Self::ENCODED_LEN,
22634 __tmp.remaining(),
22635 )
22636 }
22637 __tmp.put_f32_le(self.nav_roll);
22638 __tmp.put_f32_le(self.nav_pitch);
22639 __tmp.put_f32_le(self.alt_error);
22640 __tmp.put_f32_le(self.aspd_error);
22641 __tmp.put_f32_le(self.xtrack_error);
22642 __tmp.put_i16_le(self.nav_bearing);
22643 __tmp.put_i16_le(self.target_bearing);
22644 __tmp.put_u16_le(self.wp_dist);
22645 if matches!(version, MavlinkVersion::V2) {
22646 let len = __tmp.len();
22647 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22648 } else {
22649 __tmp.len()
22650 }
22651 }
22652}
22653#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
22654#[doc = ""]
22655#[doc = "ID: 330"]
22656#[derive(Debug, Clone, PartialEq)]
22657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22658#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22659#[cfg_attr(feature = "ts", derive(TS))]
22660#[cfg_attr(feature = "ts", ts(export))]
22661pub struct OBSTACLE_DISTANCE_DATA {
22662 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22663 pub time_usec: u64,
22664 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
22665 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22666 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22667 pub distances: [u16; 72],
22668 #[doc = "Minimum distance the sensor can measure."]
22669 pub min_distance: u16,
22670 #[doc = "Maximum distance the sensor can measure."]
22671 pub max_distance: u16,
22672 #[doc = "Class id of the distance sensor type."]
22673 pub sensor_type: MavDistanceSensor,
22674 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
22675 pub increment: u8,
22676 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
22677 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22678 pub increment_f: f32,
22679 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
22680 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22681 pub angle_offset: f32,
22682 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
22683 #[cfg_attr(feature = "serde", serde(default))]
22684 pub frame: MavFrame,
22685}
22686impl OBSTACLE_DISTANCE_DATA {
22687 pub const ENCODED_LEN: usize = 167usize;
22688 pub const DEFAULT: Self = Self {
22689 time_usec: 0_u64,
22690 distances: [0_u16; 72usize],
22691 min_distance: 0_u16,
22692 max_distance: 0_u16,
22693 sensor_type: MavDistanceSensor::DEFAULT,
22694 increment: 0_u8,
22695 increment_f: 0.0_f32,
22696 angle_offset: 0.0_f32,
22697 frame: MavFrame::DEFAULT,
22698 };
22699 #[cfg(feature = "arbitrary")]
22700 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22701 use arbitrary::{Arbitrary, Unstructured};
22702 let mut buf = [0u8; 1024];
22703 rng.fill_bytes(&mut buf);
22704 let mut unstructured = Unstructured::new(&buf);
22705 Self::arbitrary(&mut unstructured).unwrap_or_default()
22706 }
22707}
22708impl Default for OBSTACLE_DISTANCE_DATA {
22709 fn default() -> Self {
22710 Self::DEFAULT.clone()
22711 }
22712}
22713impl MessageData for OBSTACLE_DISTANCE_DATA {
22714 type Message = MavMessage;
22715 const ID: u32 = 330u32;
22716 const NAME: &'static str = "OBSTACLE_DISTANCE";
22717 const EXTRA_CRC: u8 = 23u8;
22718 const ENCODED_LEN: usize = 167usize;
22719 fn deser(
22720 _version: MavlinkVersion,
22721 __input: &[u8],
22722 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22723 let avail_len = __input.len();
22724 let mut payload_buf = [0; Self::ENCODED_LEN];
22725 let mut buf = if avail_len < Self::ENCODED_LEN {
22726 payload_buf[0..avail_len].copy_from_slice(__input);
22727 Bytes::new(&payload_buf)
22728 } else {
22729 Bytes::new(__input)
22730 };
22731 let mut __struct = Self::default();
22732 __struct.time_usec = buf.get_u64_le()?;
22733 for v in &mut __struct.distances {
22734 let val = buf.get_u16_le()?;
22735 *v = val;
22736 }
22737 __struct.min_distance = buf.get_u16_le()?;
22738 __struct.max_distance = buf.get_u16_le()?;
22739 let tmp = buf.get_u8()?;
22740 __struct.sensor_type =
22741 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22742 enum_type: "MavDistanceSensor",
22743 value: tmp as u64,
22744 })?;
22745 __struct.increment = buf.get_u8()?;
22746 __struct.increment_f = buf.get_f32_le()?;
22747 __struct.angle_offset = buf.get_f32_le()?;
22748 let tmp = buf.get_u8()?;
22749 __struct.frame =
22750 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22751 enum_type: "MavFrame",
22752 value: tmp as u64,
22753 })?;
22754 Ok(__struct)
22755 }
22756 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22757 let mut __tmp = BytesMut::new(bytes);
22758 #[allow(clippy::absurd_extreme_comparisons)]
22759 #[allow(unused_comparisons)]
22760 if __tmp.remaining() < Self::ENCODED_LEN {
22761 panic!(
22762 "buffer is too small (need {} bytes, but got {})",
22763 Self::ENCODED_LEN,
22764 __tmp.remaining(),
22765 )
22766 }
22767 __tmp.put_u64_le(self.time_usec);
22768 for val in &self.distances {
22769 __tmp.put_u16_le(*val);
22770 }
22771 __tmp.put_u16_le(self.min_distance);
22772 __tmp.put_u16_le(self.max_distance);
22773 __tmp.put_u8(self.sensor_type as u8);
22774 __tmp.put_u8(self.increment);
22775 if matches!(version, MavlinkVersion::V2) {
22776 __tmp.put_f32_le(self.increment_f);
22777 __tmp.put_f32_le(self.angle_offset);
22778 __tmp.put_u8(self.frame as u8);
22779 let len = __tmp.len();
22780 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22781 } else {
22782 __tmp.len()
22783 }
22784 }
22785}
22786#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
22787#[doc = ""]
22788#[doc = "ID: 331"]
22789#[derive(Debug, Clone, PartialEq)]
22790#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22791#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22792#[cfg_attr(feature = "ts", derive(TS))]
22793#[cfg_attr(feature = "ts", ts(export))]
22794pub struct ODOMETRY_DATA {
22795 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22796 pub time_usec: u64,
22797 #[doc = "X Position"]
22798 pub x: f32,
22799 #[doc = "Y Position"]
22800 pub y: f32,
22801 #[doc = "Z Position"]
22802 pub z: f32,
22803 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
22804 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22805 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22806 pub q: [f32; 4],
22807 #[doc = "X linear speed"]
22808 pub vx: f32,
22809 #[doc = "Y linear speed"]
22810 pub vy: f32,
22811 #[doc = "Z linear speed"]
22812 pub vz: f32,
22813 #[doc = "Roll angular speed"]
22814 pub rollspeed: f32,
22815 #[doc = "Pitch angular speed"]
22816 pub pitchspeed: f32,
22817 #[doc = "Yaw angular speed"]
22818 pub yawspeed: f32,
22819 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
22820 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22821 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22822 pub pose_covariance: [f32; 21],
22823 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
22824 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22825 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22826 pub velocity_covariance: [f32; 21],
22827 #[doc = "Coordinate frame of reference for the pose data."]
22828 pub frame_id: MavFrame,
22829 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
22830 pub child_frame_id: MavFrame,
22831 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
22832 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22833 pub reset_counter: u8,
22834 #[doc = "Type of estimator that is providing the odometry."]
22835 #[cfg_attr(feature = "serde", serde(default))]
22836 pub estimator_type: MavEstimatorType,
22837 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
22838 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22839 pub quality: i8,
22840}
22841impl ODOMETRY_DATA {
22842 pub const ENCODED_LEN: usize = 233usize;
22843 pub const DEFAULT: Self = Self {
22844 time_usec: 0_u64,
22845 x: 0.0_f32,
22846 y: 0.0_f32,
22847 z: 0.0_f32,
22848 q: [0.0_f32; 4usize],
22849 vx: 0.0_f32,
22850 vy: 0.0_f32,
22851 vz: 0.0_f32,
22852 rollspeed: 0.0_f32,
22853 pitchspeed: 0.0_f32,
22854 yawspeed: 0.0_f32,
22855 pose_covariance: [0.0_f32; 21usize],
22856 velocity_covariance: [0.0_f32; 21usize],
22857 frame_id: MavFrame::DEFAULT,
22858 child_frame_id: MavFrame::DEFAULT,
22859 reset_counter: 0_u8,
22860 estimator_type: MavEstimatorType::DEFAULT,
22861 quality: 0_i8,
22862 };
22863 #[cfg(feature = "arbitrary")]
22864 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22865 use arbitrary::{Arbitrary, Unstructured};
22866 let mut buf = [0u8; 1024];
22867 rng.fill_bytes(&mut buf);
22868 let mut unstructured = Unstructured::new(&buf);
22869 Self::arbitrary(&mut unstructured).unwrap_or_default()
22870 }
22871}
22872impl Default for ODOMETRY_DATA {
22873 fn default() -> Self {
22874 Self::DEFAULT.clone()
22875 }
22876}
22877impl MessageData for ODOMETRY_DATA {
22878 type Message = MavMessage;
22879 const ID: u32 = 331u32;
22880 const NAME: &'static str = "ODOMETRY";
22881 const EXTRA_CRC: u8 = 91u8;
22882 const ENCODED_LEN: usize = 233usize;
22883 fn deser(
22884 _version: MavlinkVersion,
22885 __input: &[u8],
22886 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22887 let avail_len = __input.len();
22888 let mut payload_buf = [0; Self::ENCODED_LEN];
22889 let mut buf = if avail_len < Self::ENCODED_LEN {
22890 payload_buf[0..avail_len].copy_from_slice(__input);
22891 Bytes::new(&payload_buf)
22892 } else {
22893 Bytes::new(__input)
22894 };
22895 let mut __struct = Self::default();
22896 __struct.time_usec = buf.get_u64_le()?;
22897 __struct.x = buf.get_f32_le()?;
22898 __struct.y = buf.get_f32_le()?;
22899 __struct.z = buf.get_f32_le()?;
22900 for v in &mut __struct.q {
22901 let val = buf.get_f32_le()?;
22902 *v = val;
22903 }
22904 __struct.vx = buf.get_f32_le()?;
22905 __struct.vy = buf.get_f32_le()?;
22906 __struct.vz = buf.get_f32_le()?;
22907 __struct.rollspeed = buf.get_f32_le()?;
22908 __struct.pitchspeed = buf.get_f32_le()?;
22909 __struct.yawspeed = buf.get_f32_le()?;
22910 for v in &mut __struct.pose_covariance {
22911 let val = buf.get_f32_le()?;
22912 *v = val;
22913 }
22914 for v in &mut __struct.velocity_covariance {
22915 let val = buf.get_f32_le()?;
22916 *v = val;
22917 }
22918 let tmp = buf.get_u8()?;
22919 __struct.frame_id =
22920 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22921 enum_type: "MavFrame",
22922 value: tmp as u64,
22923 })?;
22924 let tmp = buf.get_u8()?;
22925 __struct.child_frame_id =
22926 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22927 enum_type: "MavFrame",
22928 value: tmp as u64,
22929 })?;
22930 __struct.reset_counter = buf.get_u8()?;
22931 let tmp = buf.get_u8()?;
22932 __struct.estimator_type =
22933 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22934 enum_type: "MavEstimatorType",
22935 value: tmp as u64,
22936 })?;
22937 __struct.quality = buf.get_i8()?;
22938 Ok(__struct)
22939 }
22940 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22941 let mut __tmp = BytesMut::new(bytes);
22942 #[allow(clippy::absurd_extreme_comparisons)]
22943 #[allow(unused_comparisons)]
22944 if __tmp.remaining() < Self::ENCODED_LEN {
22945 panic!(
22946 "buffer is too small (need {} bytes, but got {})",
22947 Self::ENCODED_LEN,
22948 __tmp.remaining(),
22949 )
22950 }
22951 __tmp.put_u64_le(self.time_usec);
22952 __tmp.put_f32_le(self.x);
22953 __tmp.put_f32_le(self.y);
22954 __tmp.put_f32_le(self.z);
22955 for val in &self.q {
22956 __tmp.put_f32_le(*val);
22957 }
22958 __tmp.put_f32_le(self.vx);
22959 __tmp.put_f32_le(self.vy);
22960 __tmp.put_f32_le(self.vz);
22961 __tmp.put_f32_le(self.rollspeed);
22962 __tmp.put_f32_le(self.pitchspeed);
22963 __tmp.put_f32_le(self.yawspeed);
22964 for val in &self.pose_covariance {
22965 __tmp.put_f32_le(*val);
22966 }
22967 for val in &self.velocity_covariance {
22968 __tmp.put_f32_le(*val);
22969 }
22970 __tmp.put_u8(self.frame_id as u8);
22971 __tmp.put_u8(self.child_frame_id as u8);
22972 if matches!(version, MavlinkVersion::V2) {
22973 __tmp.put_u8(self.reset_counter);
22974 __tmp.put_u8(self.estimator_type as u8);
22975 __tmp.put_i8(self.quality);
22976 let len = __tmp.len();
22977 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22978 } else {
22979 __tmp.len()
22980 }
22981 }
22982}
22983#[doc = "Hardware status sent by an onboard computer."]
22984#[doc = ""]
22985#[doc = "ID: 390"]
22986#[derive(Debug, Clone, PartialEq)]
22987#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22988#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22989#[cfg_attr(feature = "ts", derive(TS))]
22990#[cfg_attr(feature = "ts", ts(export))]
22991pub struct ONBOARD_COMPUTER_STATUS_DATA {
22992 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22993 pub time_usec: u64,
22994 #[doc = "Time since system boot."]
22995 pub uptime: u32,
22996 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
22997 pub ram_usage: u32,
22998 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
22999 pub ram_total: u32,
23000 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
23001 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23002 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23003 pub storage_type: [u32; 4],
23004 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
23005 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23006 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23007 pub storage_usage: [u32; 4],
23008 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
23009 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23010 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23011 pub storage_total: [u32; 4],
23012 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
23013 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23014 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23015 pub link_type: [u32; 6],
23016 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
23017 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23018 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23019 pub link_tx_rate: [u32; 6],
23020 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
23021 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23022 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23023 pub link_rx_rate: [u32; 6],
23024 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
23025 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23026 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23027 pub link_tx_max: [u32; 6],
23028 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
23029 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23030 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23031 pub link_rx_max: [u32; 6],
23032 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
23033 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23034 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23035 pub fan_speed: [i16; 4],
23036 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
23037 pub mavtype: u8,
23038 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
23039 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23040 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23041 pub cpu_cores: [u8; 8],
23042 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
23043 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23044 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23045 pub cpu_combined: [u8; 10],
23046 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
23047 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23048 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23049 pub gpu_cores: [u8; 4],
23050 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
23051 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23052 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23053 pub gpu_combined: [u8; 10],
23054 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
23055 pub temperature_board: i8,
23056 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
23057 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23058 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23059 pub temperature_core: [i8; 8],
23060}
23061impl ONBOARD_COMPUTER_STATUS_DATA {
23062 pub const ENCODED_LEN: usize = 238usize;
23063 pub const DEFAULT: Self = Self {
23064 time_usec: 0_u64,
23065 uptime: 0_u32,
23066 ram_usage: 0_u32,
23067 ram_total: 0_u32,
23068 storage_type: [0_u32; 4usize],
23069 storage_usage: [0_u32; 4usize],
23070 storage_total: [0_u32; 4usize],
23071 link_type: [0_u32; 6usize],
23072 link_tx_rate: [0_u32; 6usize],
23073 link_rx_rate: [0_u32; 6usize],
23074 link_tx_max: [0_u32; 6usize],
23075 link_rx_max: [0_u32; 6usize],
23076 fan_speed: [0_i16; 4usize],
23077 mavtype: 0_u8,
23078 cpu_cores: [0_u8; 8usize],
23079 cpu_combined: [0_u8; 10usize],
23080 gpu_cores: [0_u8; 4usize],
23081 gpu_combined: [0_u8; 10usize],
23082 temperature_board: 0_i8,
23083 temperature_core: [0_i8; 8usize],
23084 };
23085 #[cfg(feature = "arbitrary")]
23086 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23087 use arbitrary::{Arbitrary, Unstructured};
23088 let mut buf = [0u8; 1024];
23089 rng.fill_bytes(&mut buf);
23090 let mut unstructured = Unstructured::new(&buf);
23091 Self::arbitrary(&mut unstructured).unwrap_or_default()
23092 }
23093}
23094impl Default for ONBOARD_COMPUTER_STATUS_DATA {
23095 fn default() -> Self {
23096 Self::DEFAULT.clone()
23097 }
23098}
23099impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
23100 type Message = MavMessage;
23101 const ID: u32 = 390u32;
23102 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
23103 const EXTRA_CRC: u8 = 156u8;
23104 const ENCODED_LEN: usize = 238usize;
23105 fn deser(
23106 _version: MavlinkVersion,
23107 __input: &[u8],
23108 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23109 let avail_len = __input.len();
23110 let mut payload_buf = [0; Self::ENCODED_LEN];
23111 let mut buf = if avail_len < Self::ENCODED_LEN {
23112 payload_buf[0..avail_len].copy_from_slice(__input);
23113 Bytes::new(&payload_buf)
23114 } else {
23115 Bytes::new(__input)
23116 };
23117 let mut __struct = Self::default();
23118 __struct.time_usec = buf.get_u64_le()?;
23119 __struct.uptime = buf.get_u32_le()?;
23120 __struct.ram_usage = buf.get_u32_le()?;
23121 __struct.ram_total = buf.get_u32_le()?;
23122 for v in &mut __struct.storage_type {
23123 let val = buf.get_u32_le()?;
23124 *v = val;
23125 }
23126 for v in &mut __struct.storage_usage {
23127 let val = buf.get_u32_le()?;
23128 *v = val;
23129 }
23130 for v in &mut __struct.storage_total {
23131 let val = buf.get_u32_le()?;
23132 *v = val;
23133 }
23134 for v in &mut __struct.link_type {
23135 let val = buf.get_u32_le()?;
23136 *v = val;
23137 }
23138 for v in &mut __struct.link_tx_rate {
23139 let val = buf.get_u32_le()?;
23140 *v = val;
23141 }
23142 for v in &mut __struct.link_rx_rate {
23143 let val = buf.get_u32_le()?;
23144 *v = val;
23145 }
23146 for v in &mut __struct.link_tx_max {
23147 let val = buf.get_u32_le()?;
23148 *v = val;
23149 }
23150 for v in &mut __struct.link_rx_max {
23151 let val = buf.get_u32_le()?;
23152 *v = val;
23153 }
23154 for v in &mut __struct.fan_speed {
23155 let val = buf.get_i16_le()?;
23156 *v = val;
23157 }
23158 __struct.mavtype = buf.get_u8()?;
23159 for v in &mut __struct.cpu_cores {
23160 let val = buf.get_u8()?;
23161 *v = val;
23162 }
23163 for v in &mut __struct.cpu_combined {
23164 let val = buf.get_u8()?;
23165 *v = val;
23166 }
23167 for v in &mut __struct.gpu_cores {
23168 let val = buf.get_u8()?;
23169 *v = val;
23170 }
23171 for v in &mut __struct.gpu_combined {
23172 let val = buf.get_u8()?;
23173 *v = val;
23174 }
23175 __struct.temperature_board = buf.get_i8()?;
23176 for v in &mut __struct.temperature_core {
23177 let val = buf.get_i8()?;
23178 *v = val;
23179 }
23180 Ok(__struct)
23181 }
23182 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23183 let mut __tmp = BytesMut::new(bytes);
23184 #[allow(clippy::absurd_extreme_comparisons)]
23185 #[allow(unused_comparisons)]
23186 if __tmp.remaining() < Self::ENCODED_LEN {
23187 panic!(
23188 "buffer is too small (need {} bytes, but got {})",
23189 Self::ENCODED_LEN,
23190 __tmp.remaining(),
23191 )
23192 }
23193 __tmp.put_u64_le(self.time_usec);
23194 __tmp.put_u32_le(self.uptime);
23195 __tmp.put_u32_le(self.ram_usage);
23196 __tmp.put_u32_le(self.ram_total);
23197 for val in &self.storage_type {
23198 __tmp.put_u32_le(*val);
23199 }
23200 for val in &self.storage_usage {
23201 __tmp.put_u32_le(*val);
23202 }
23203 for val in &self.storage_total {
23204 __tmp.put_u32_le(*val);
23205 }
23206 for val in &self.link_type {
23207 __tmp.put_u32_le(*val);
23208 }
23209 for val in &self.link_tx_rate {
23210 __tmp.put_u32_le(*val);
23211 }
23212 for val in &self.link_rx_rate {
23213 __tmp.put_u32_le(*val);
23214 }
23215 for val in &self.link_tx_max {
23216 __tmp.put_u32_le(*val);
23217 }
23218 for val in &self.link_rx_max {
23219 __tmp.put_u32_le(*val);
23220 }
23221 for val in &self.fan_speed {
23222 __tmp.put_i16_le(*val);
23223 }
23224 __tmp.put_u8(self.mavtype);
23225 for val in &self.cpu_cores {
23226 __tmp.put_u8(*val);
23227 }
23228 for val in &self.cpu_combined {
23229 __tmp.put_u8(*val);
23230 }
23231 for val in &self.gpu_cores {
23232 __tmp.put_u8(*val);
23233 }
23234 for val in &self.gpu_combined {
23235 __tmp.put_u8(*val);
23236 }
23237 __tmp.put_i8(self.temperature_board);
23238 for val in &self.temperature_core {
23239 __tmp.put_i8(*val);
23240 }
23241 if matches!(version, MavlinkVersion::V2) {
23242 let len = __tmp.len();
23243 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23244 } else {
23245 __tmp.len()
23246 }
23247 }
23248}
23249#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
23250#[doc = ""]
23251#[doc = "ID: 12918"]
23252#[derive(Debug, Clone, PartialEq)]
23253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23254#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23255#[cfg_attr(feature = "ts", derive(TS))]
23256#[cfg_attr(feature = "ts", ts(export))]
23257pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
23258 #[doc = "Status level indicating if arming is allowed."]
23259 pub status: MavOdidArmStatus,
23260 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
23261 #[cfg_attr(feature = "ts", ts(type = "string"))]
23262 pub error: CharArray<50>,
23263}
23264impl OPEN_DRONE_ID_ARM_STATUS_DATA {
23265 pub const ENCODED_LEN: usize = 51usize;
23266 pub const DEFAULT: Self = Self {
23267 status: MavOdidArmStatus::DEFAULT,
23268 error: CharArray::new([0_u8; 50usize]),
23269 };
23270 #[cfg(feature = "arbitrary")]
23271 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23272 use arbitrary::{Arbitrary, Unstructured};
23273 let mut buf = [0u8; 1024];
23274 rng.fill_bytes(&mut buf);
23275 let mut unstructured = Unstructured::new(&buf);
23276 Self::arbitrary(&mut unstructured).unwrap_or_default()
23277 }
23278}
23279impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
23280 fn default() -> Self {
23281 Self::DEFAULT.clone()
23282 }
23283}
23284impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
23285 type Message = MavMessage;
23286 const ID: u32 = 12918u32;
23287 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
23288 const EXTRA_CRC: u8 = 139u8;
23289 const ENCODED_LEN: usize = 51usize;
23290 fn deser(
23291 _version: MavlinkVersion,
23292 __input: &[u8],
23293 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23294 let avail_len = __input.len();
23295 let mut payload_buf = [0; Self::ENCODED_LEN];
23296 let mut buf = if avail_len < Self::ENCODED_LEN {
23297 payload_buf[0..avail_len].copy_from_slice(__input);
23298 Bytes::new(&payload_buf)
23299 } else {
23300 Bytes::new(__input)
23301 };
23302 let mut __struct = Self::default();
23303 let tmp = buf.get_u8()?;
23304 __struct.status =
23305 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23306 enum_type: "MavOdidArmStatus",
23307 value: tmp as u64,
23308 })?;
23309 let mut tmp = [0_u8; 50usize];
23310 for v in &mut tmp {
23311 *v = buf.get_u8()?;
23312 }
23313 __struct.error = CharArray::new(tmp);
23314 Ok(__struct)
23315 }
23316 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23317 let mut __tmp = BytesMut::new(bytes);
23318 #[allow(clippy::absurd_extreme_comparisons)]
23319 #[allow(unused_comparisons)]
23320 if __tmp.remaining() < Self::ENCODED_LEN {
23321 panic!(
23322 "buffer is too small (need {} bytes, but got {})",
23323 Self::ENCODED_LEN,
23324 __tmp.remaining(),
23325 )
23326 }
23327 __tmp.put_u8(self.status as u8);
23328 for val in &self.error {
23329 __tmp.put_u8(*val);
23330 }
23331 if matches!(version, MavlinkVersion::V2) {
23332 let len = __tmp.len();
23333 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23334 } else {
23335 __tmp.len()
23336 }
23337 }
23338}
23339#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
23340#[doc = ""]
23341#[doc = "ID: 12902"]
23342#[derive(Debug, Clone, PartialEq)]
23343#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23344#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23345#[cfg_attr(feature = "ts", derive(TS))]
23346#[cfg_attr(feature = "ts", ts(export))]
23347pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
23348 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
23349 pub timestamp: u32,
23350 #[doc = "System ID (0 for broadcast)."]
23351 pub target_system: u8,
23352 #[doc = "Component ID (0 for broadcast)."]
23353 pub target_component: u8,
23354 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23355 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23356 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23357 pub id_or_mac: [u8; 20],
23358 #[doc = "Indicates the type of authentication."]
23359 pub authentication_type: MavOdidAuthType,
23360 #[doc = "Allowed range is 0 - 15."]
23361 pub data_page: u8,
23362 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
23363 pub last_page_index: u8,
23364 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
23365 pub length: u8,
23366 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
23367 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23368 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23369 pub authentication_data: [u8; 23],
23370}
23371impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
23372 pub const ENCODED_LEN: usize = 53usize;
23373 pub const DEFAULT: Self = Self {
23374 timestamp: 0_u32,
23375 target_system: 0_u8,
23376 target_component: 0_u8,
23377 id_or_mac: [0_u8; 20usize],
23378 authentication_type: MavOdidAuthType::DEFAULT,
23379 data_page: 0_u8,
23380 last_page_index: 0_u8,
23381 length: 0_u8,
23382 authentication_data: [0_u8; 23usize],
23383 };
23384 #[cfg(feature = "arbitrary")]
23385 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23386 use arbitrary::{Arbitrary, Unstructured};
23387 let mut buf = [0u8; 1024];
23388 rng.fill_bytes(&mut buf);
23389 let mut unstructured = Unstructured::new(&buf);
23390 Self::arbitrary(&mut unstructured).unwrap_or_default()
23391 }
23392}
23393impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
23394 fn default() -> Self {
23395 Self::DEFAULT.clone()
23396 }
23397}
23398impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
23399 type Message = MavMessage;
23400 const ID: u32 = 12902u32;
23401 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
23402 const EXTRA_CRC: u8 = 140u8;
23403 const ENCODED_LEN: usize = 53usize;
23404 fn deser(
23405 _version: MavlinkVersion,
23406 __input: &[u8],
23407 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23408 let avail_len = __input.len();
23409 let mut payload_buf = [0; Self::ENCODED_LEN];
23410 let mut buf = if avail_len < Self::ENCODED_LEN {
23411 payload_buf[0..avail_len].copy_from_slice(__input);
23412 Bytes::new(&payload_buf)
23413 } else {
23414 Bytes::new(__input)
23415 };
23416 let mut __struct = Self::default();
23417 __struct.timestamp = buf.get_u32_le()?;
23418 __struct.target_system = buf.get_u8()?;
23419 __struct.target_component = buf.get_u8()?;
23420 for v in &mut __struct.id_or_mac {
23421 let val = buf.get_u8()?;
23422 *v = val;
23423 }
23424 let tmp = buf.get_u8()?;
23425 __struct.authentication_type =
23426 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23427 enum_type: "MavOdidAuthType",
23428 value: tmp as u64,
23429 })?;
23430 __struct.data_page = buf.get_u8()?;
23431 __struct.last_page_index = buf.get_u8()?;
23432 __struct.length = buf.get_u8()?;
23433 for v in &mut __struct.authentication_data {
23434 let val = buf.get_u8()?;
23435 *v = val;
23436 }
23437 Ok(__struct)
23438 }
23439 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23440 let mut __tmp = BytesMut::new(bytes);
23441 #[allow(clippy::absurd_extreme_comparisons)]
23442 #[allow(unused_comparisons)]
23443 if __tmp.remaining() < Self::ENCODED_LEN {
23444 panic!(
23445 "buffer is too small (need {} bytes, but got {})",
23446 Self::ENCODED_LEN,
23447 __tmp.remaining(),
23448 )
23449 }
23450 __tmp.put_u32_le(self.timestamp);
23451 __tmp.put_u8(self.target_system);
23452 __tmp.put_u8(self.target_component);
23453 for val in &self.id_or_mac {
23454 __tmp.put_u8(*val);
23455 }
23456 __tmp.put_u8(self.authentication_type as u8);
23457 __tmp.put_u8(self.data_page);
23458 __tmp.put_u8(self.last_page_index);
23459 __tmp.put_u8(self.length);
23460 for val in &self.authentication_data {
23461 __tmp.put_u8(*val);
23462 }
23463 if matches!(version, MavlinkVersion::V2) {
23464 let len = __tmp.len();
23465 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23466 } else {
23467 __tmp.len()
23468 }
23469 }
23470}
23471#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
23472#[doc = ""]
23473#[doc = "ID: 12900"]
23474#[derive(Debug, Clone, PartialEq)]
23475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23476#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23477#[cfg_attr(feature = "ts", derive(TS))]
23478#[cfg_attr(feature = "ts", ts(export))]
23479pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
23480 #[doc = "System ID (0 for broadcast)."]
23481 pub target_system: u8,
23482 #[doc = "Component ID (0 for broadcast)."]
23483 pub target_component: u8,
23484 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23485 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23486 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23487 pub id_or_mac: [u8; 20],
23488 #[doc = "Indicates the format for the uas_id field of this message."]
23489 pub id_type: MavOdidIdType,
23490 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
23491 pub ua_type: MavOdidUaType,
23492 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
23493 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23494 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23495 pub uas_id: [u8; 20],
23496}
23497impl OPEN_DRONE_ID_BASIC_ID_DATA {
23498 pub const ENCODED_LEN: usize = 44usize;
23499 pub const DEFAULT: Self = Self {
23500 target_system: 0_u8,
23501 target_component: 0_u8,
23502 id_or_mac: [0_u8; 20usize],
23503 id_type: MavOdidIdType::DEFAULT,
23504 ua_type: MavOdidUaType::DEFAULT,
23505 uas_id: [0_u8; 20usize],
23506 };
23507 #[cfg(feature = "arbitrary")]
23508 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23509 use arbitrary::{Arbitrary, Unstructured};
23510 let mut buf = [0u8; 1024];
23511 rng.fill_bytes(&mut buf);
23512 let mut unstructured = Unstructured::new(&buf);
23513 Self::arbitrary(&mut unstructured).unwrap_or_default()
23514 }
23515}
23516impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
23517 fn default() -> Self {
23518 Self::DEFAULT.clone()
23519 }
23520}
23521impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
23522 type Message = MavMessage;
23523 const ID: u32 = 12900u32;
23524 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
23525 const EXTRA_CRC: u8 = 114u8;
23526 const ENCODED_LEN: usize = 44usize;
23527 fn deser(
23528 _version: MavlinkVersion,
23529 __input: &[u8],
23530 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23531 let avail_len = __input.len();
23532 let mut payload_buf = [0; Self::ENCODED_LEN];
23533 let mut buf = if avail_len < Self::ENCODED_LEN {
23534 payload_buf[0..avail_len].copy_from_slice(__input);
23535 Bytes::new(&payload_buf)
23536 } else {
23537 Bytes::new(__input)
23538 };
23539 let mut __struct = Self::default();
23540 __struct.target_system = buf.get_u8()?;
23541 __struct.target_component = buf.get_u8()?;
23542 for v in &mut __struct.id_or_mac {
23543 let val = buf.get_u8()?;
23544 *v = val;
23545 }
23546 let tmp = buf.get_u8()?;
23547 __struct.id_type =
23548 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23549 enum_type: "MavOdidIdType",
23550 value: tmp as u64,
23551 })?;
23552 let tmp = buf.get_u8()?;
23553 __struct.ua_type =
23554 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23555 enum_type: "MavOdidUaType",
23556 value: tmp as u64,
23557 })?;
23558 for v in &mut __struct.uas_id {
23559 let val = buf.get_u8()?;
23560 *v = val;
23561 }
23562 Ok(__struct)
23563 }
23564 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23565 let mut __tmp = BytesMut::new(bytes);
23566 #[allow(clippy::absurd_extreme_comparisons)]
23567 #[allow(unused_comparisons)]
23568 if __tmp.remaining() < Self::ENCODED_LEN {
23569 panic!(
23570 "buffer is too small (need {} bytes, but got {})",
23571 Self::ENCODED_LEN,
23572 __tmp.remaining(),
23573 )
23574 }
23575 __tmp.put_u8(self.target_system);
23576 __tmp.put_u8(self.target_component);
23577 for val in &self.id_or_mac {
23578 __tmp.put_u8(*val);
23579 }
23580 __tmp.put_u8(self.id_type as u8);
23581 __tmp.put_u8(self.ua_type as u8);
23582 for val in &self.uas_id {
23583 __tmp.put_u8(*val);
23584 }
23585 if matches!(version, MavlinkVersion::V2) {
23586 let len = __tmp.len();
23587 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23588 } else {
23589 __tmp.len()
23590 }
23591 }
23592}
23593#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
23594#[doc = ""]
23595#[doc = "ID: 12901"]
23596#[derive(Debug, Clone, PartialEq)]
23597#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23598#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23599#[cfg_attr(feature = "ts", derive(TS))]
23600#[cfg_attr(feature = "ts", ts(export))]
23601pub struct OPEN_DRONE_ID_LOCATION_DATA {
23602 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
23603 pub latitude: i32,
23604 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
23605 pub longitude: i32,
23606 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
23607 pub altitude_barometric: f32,
23608 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
23609 pub altitude_geodetic: f32,
23610 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
23611 pub height: f32,
23612 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
23613 pub timestamp: f32,
23614 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
23615 pub direction: u16,
23616 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
23617 pub speed_horizontal: u16,
23618 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
23619 pub speed_vertical: i16,
23620 #[doc = "System ID (0 for broadcast)."]
23621 pub target_system: u8,
23622 #[doc = "Component ID (0 for broadcast)."]
23623 pub target_component: u8,
23624 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23625 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23626 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23627 pub id_or_mac: [u8; 20],
23628 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
23629 pub status: MavOdidStatus,
23630 #[doc = "Indicates the reference point for the height field."]
23631 pub height_reference: MavOdidHeightRef,
23632 #[doc = "The accuracy of the horizontal position."]
23633 pub horizontal_accuracy: MavOdidHorAcc,
23634 #[doc = "The accuracy of the vertical position."]
23635 pub vertical_accuracy: MavOdidVerAcc,
23636 #[doc = "The accuracy of the barometric altitude."]
23637 pub barometer_accuracy: MavOdidVerAcc,
23638 #[doc = "The accuracy of the horizontal and vertical speed."]
23639 pub speed_accuracy: MavOdidSpeedAcc,
23640 #[doc = "The accuracy of the timestamps."]
23641 pub timestamp_accuracy: MavOdidTimeAcc,
23642}
23643impl OPEN_DRONE_ID_LOCATION_DATA {
23644 pub const ENCODED_LEN: usize = 59usize;
23645 pub const DEFAULT: Self = Self {
23646 latitude: 0_i32,
23647 longitude: 0_i32,
23648 altitude_barometric: 0.0_f32,
23649 altitude_geodetic: 0.0_f32,
23650 height: 0.0_f32,
23651 timestamp: 0.0_f32,
23652 direction: 0_u16,
23653 speed_horizontal: 0_u16,
23654 speed_vertical: 0_i16,
23655 target_system: 0_u8,
23656 target_component: 0_u8,
23657 id_or_mac: [0_u8; 20usize],
23658 status: MavOdidStatus::DEFAULT,
23659 height_reference: MavOdidHeightRef::DEFAULT,
23660 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
23661 vertical_accuracy: MavOdidVerAcc::DEFAULT,
23662 barometer_accuracy: MavOdidVerAcc::DEFAULT,
23663 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
23664 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
23665 };
23666 #[cfg(feature = "arbitrary")]
23667 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23668 use arbitrary::{Arbitrary, Unstructured};
23669 let mut buf = [0u8; 1024];
23670 rng.fill_bytes(&mut buf);
23671 let mut unstructured = Unstructured::new(&buf);
23672 Self::arbitrary(&mut unstructured).unwrap_or_default()
23673 }
23674}
23675impl Default for OPEN_DRONE_ID_LOCATION_DATA {
23676 fn default() -> Self {
23677 Self::DEFAULT.clone()
23678 }
23679}
23680impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
23681 type Message = MavMessage;
23682 const ID: u32 = 12901u32;
23683 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
23684 const EXTRA_CRC: u8 = 254u8;
23685 const ENCODED_LEN: usize = 59usize;
23686 fn deser(
23687 _version: MavlinkVersion,
23688 __input: &[u8],
23689 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23690 let avail_len = __input.len();
23691 let mut payload_buf = [0; Self::ENCODED_LEN];
23692 let mut buf = if avail_len < Self::ENCODED_LEN {
23693 payload_buf[0..avail_len].copy_from_slice(__input);
23694 Bytes::new(&payload_buf)
23695 } else {
23696 Bytes::new(__input)
23697 };
23698 let mut __struct = Self::default();
23699 __struct.latitude = buf.get_i32_le()?;
23700 __struct.longitude = buf.get_i32_le()?;
23701 __struct.altitude_barometric = buf.get_f32_le()?;
23702 __struct.altitude_geodetic = buf.get_f32_le()?;
23703 __struct.height = buf.get_f32_le()?;
23704 __struct.timestamp = buf.get_f32_le()?;
23705 __struct.direction = buf.get_u16_le()?;
23706 __struct.speed_horizontal = buf.get_u16_le()?;
23707 __struct.speed_vertical = buf.get_i16_le()?;
23708 __struct.target_system = buf.get_u8()?;
23709 __struct.target_component = buf.get_u8()?;
23710 for v in &mut __struct.id_or_mac {
23711 let val = buf.get_u8()?;
23712 *v = val;
23713 }
23714 let tmp = buf.get_u8()?;
23715 __struct.status =
23716 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23717 enum_type: "MavOdidStatus",
23718 value: tmp as u64,
23719 })?;
23720 let tmp = buf.get_u8()?;
23721 __struct.height_reference =
23722 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23723 enum_type: "MavOdidHeightRef",
23724 value: tmp as u64,
23725 })?;
23726 let tmp = buf.get_u8()?;
23727 __struct.horizontal_accuracy =
23728 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23729 enum_type: "MavOdidHorAcc",
23730 value: tmp as u64,
23731 })?;
23732 let tmp = buf.get_u8()?;
23733 __struct.vertical_accuracy =
23734 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23735 enum_type: "MavOdidVerAcc",
23736 value: tmp as u64,
23737 })?;
23738 let tmp = buf.get_u8()?;
23739 __struct.barometer_accuracy =
23740 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23741 enum_type: "MavOdidVerAcc",
23742 value: tmp as u64,
23743 })?;
23744 let tmp = buf.get_u8()?;
23745 __struct.speed_accuracy =
23746 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23747 enum_type: "MavOdidSpeedAcc",
23748 value: tmp as u64,
23749 })?;
23750 let tmp = buf.get_u8()?;
23751 __struct.timestamp_accuracy =
23752 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23753 enum_type: "MavOdidTimeAcc",
23754 value: tmp as u64,
23755 })?;
23756 Ok(__struct)
23757 }
23758 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23759 let mut __tmp = BytesMut::new(bytes);
23760 #[allow(clippy::absurd_extreme_comparisons)]
23761 #[allow(unused_comparisons)]
23762 if __tmp.remaining() < Self::ENCODED_LEN {
23763 panic!(
23764 "buffer is too small (need {} bytes, but got {})",
23765 Self::ENCODED_LEN,
23766 __tmp.remaining(),
23767 )
23768 }
23769 __tmp.put_i32_le(self.latitude);
23770 __tmp.put_i32_le(self.longitude);
23771 __tmp.put_f32_le(self.altitude_barometric);
23772 __tmp.put_f32_le(self.altitude_geodetic);
23773 __tmp.put_f32_le(self.height);
23774 __tmp.put_f32_le(self.timestamp);
23775 __tmp.put_u16_le(self.direction);
23776 __tmp.put_u16_le(self.speed_horizontal);
23777 __tmp.put_i16_le(self.speed_vertical);
23778 __tmp.put_u8(self.target_system);
23779 __tmp.put_u8(self.target_component);
23780 for val in &self.id_or_mac {
23781 __tmp.put_u8(*val);
23782 }
23783 __tmp.put_u8(self.status as u8);
23784 __tmp.put_u8(self.height_reference as u8);
23785 __tmp.put_u8(self.horizontal_accuracy as u8);
23786 __tmp.put_u8(self.vertical_accuracy as u8);
23787 __tmp.put_u8(self.barometer_accuracy as u8);
23788 __tmp.put_u8(self.speed_accuracy as u8);
23789 __tmp.put_u8(self.timestamp_accuracy as u8);
23790 if matches!(version, MavlinkVersion::V2) {
23791 let len = __tmp.len();
23792 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23793 } else {
23794 __tmp.len()
23795 }
23796 }
23797}
23798#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
23799#[doc = ""]
23800#[doc = "ID: 12915"]
23801#[derive(Debug, Clone, PartialEq)]
23802#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23803#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23804#[cfg_attr(feature = "ts", derive(TS))]
23805#[cfg_attr(feature = "ts", ts(export))]
23806pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
23807 #[doc = "System ID (0 for broadcast)."]
23808 pub target_system: u8,
23809 #[doc = "Component ID (0 for broadcast)."]
23810 pub target_component: u8,
23811 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23812 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23813 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23814 pub id_or_mac: [u8; 20],
23815 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
23816 pub single_message_size: u8,
23817 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
23818 pub msg_pack_size: u8,
23819 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
23820 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23821 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23822 pub messages: [u8; 225],
23823}
23824impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
23825 pub const ENCODED_LEN: usize = 249usize;
23826 pub const DEFAULT: Self = Self {
23827 target_system: 0_u8,
23828 target_component: 0_u8,
23829 id_or_mac: [0_u8; 20usize],
23830 single_message_size: 0_u8,
23831 msg_pack_size: 0_u8,
23832 messages: [0_u8; 225usize],
23833 };
23834 #[cfg(feature = "arbitrary")]
23835 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23836 use arbitrary::{Arbitrary, Unstructured};
23837 let mut buf = [0u8; 1024];
23838 rng.fill_bytes(&mut buf);
23839 let mut unstructured = Unstructured::new(&buf);
23840 Self::arbitrary(&mut unstructured).unwrap_or_default()
23841 }
23842}
23843impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
23844 fn default() -> Self {
23845 Self::DEFAULT.clone()
23846 }
23847}
23848impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
23849 type Message = MavMessage;
23850 const ID: u32 = 12915u32;
23851 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
23852 const EXTRA_CRC: u8 = 94u8;
23853 const ENCODED_LEN: usize = 249usize;
23854 fn deser(
23855 _version: MavlinkVersion,
23856 __input: &[u8],
23857 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23858 let avail_len = __input.len();
23859 let mut payload_buf = [0; Self::ENCODED_LEN];
23860 let mut buf = if avail_len < Self::ENCODED_LEN {
23861 payload_buf[0..avail_len].copy_from_slice(__input);
23862 Bytes::new(&payload_buf)
23863 } else {
23864 Bytes::new(__input)
23865 };
23866 let mut __struct = Self::default();
23867 __struct.target_system = buf.get_u8()?;
23868 __struct.target_component = buf.get_u8()?;
23869 for v in &mut __struct.id_or_mac {
23870 let val = buf.get_u8()?;
23871 *v = val;
23872 }
23873 __struct.single_message_size = buf.get_u8()?;
23874 __struct.msg_pack_size = buf.get_u8()?;
23875 for v in &mut __struct.messages {
23876 let val = buf.get_u8()?;
23877 *v = val;
23878 }
23879 Ok(__struct)
23880 }
23881 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23882 let mut __tmp = BytesMut::new(bytes);
23883 #[allow(clippy::absurd_extreme_comparisons)]
23884 #[allow(unused_comparisons)]
23885 if __tmp.remaining() < Self::ENCODED_LEN {
23886 panic!(
23887 "buffer is too small (need {} bytes, but got {})",
23888 Self::ENCODED_LEN,
23889 __tmp.remaining(),
23890 )
23891 }
23892 __tmp.put_u8(self.target_system);
23893 __tmp.put_u8(self.target_component);
23894 for val in &self.id_or_mac {
23895 __tmp.put_u8(*val);
23896 }
23897 __tmp.put_u8(self.single_message_size);
23898 __tmp.put_u8(self.msg_pack_size);
23899 for val in &self.messages {
23900 __tmp.put_u8(*val);
23901 }
23902 if matches!(version, MavlinkVersion::V2) {
23903 let len = __tmp.len();
23904 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23905 } else {
23906 __tmp.len()
23907 }
23908 }
23909}
23910#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
23911#[doc = ""]
23912#[doc = "ID: 12905"]
23913#[derive(Debug, Clone, PartialEq)]
23914#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23916#[cfg_attr(feature = "ts", derive(TS))]
23917#[cfg_attr(feature = "ts", ts(export))]
23918pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
23919 #[doc = "System ID (0 for broadcast)."]
23920 pub target_system: u8,
23921 #[doc = "Component ID (0 for broadcast)."]
23922 pub target_component: u8,
23923 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23924 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23925 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23926 pub id_or_mac: [u8; 20],
23927 #[doc = "Indicates the type of the operator_id field."]
23928 pub operator_id_type: MavOdidOperatorIdType,
23929 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
23930 #[cfg_attr(feature = "ts", ts(type = "string"))]
23931 pub operator_id: CharArray<20>,
23932}
23933impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
23934 pub const ENCODED_LEN: usize = 43usize;
23935 pub const DEFAULT: Self = Self {
23936 target_system: 0_u8,
23937 target_component: 0_u8,
23938 id_or_mac: [0_u8; 20usize],
23939 operator_id_type: MavOdidOperatorIdType::DEFAULT,
23940 operator_id: CharArray::new([0_u8; 20usize]),
23941 };
23942 #[cfg(feature = "arbitrary")]
23943 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23944 use arbitrary::{Arbitrary, Unstructured};
23945 let mut buf = [0u8; 1024];
23946 rng.fill_bytes(&mut buf);
23947 let mut unstructured = Unstructured::new(&buf);
23948 Self::arbitrary(&mut unstructured).unwrap_or_default()
23949 }
23950}
23951impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
23952 fn default() -> Self {
23953 Self::DEFAULT.clone()
23954 }
23955}
23956impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
23957 type Message = MavMessage;
23958 const ID: u32 = 12905u32;
23959 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
23960 const EXTRA_CRC: u8 = 49u8;
23961 const ENCODED_LEN: usize = 43usize;
23962 fn deser(
23963 _version: MavlinkVersion,
23964 __input: &[u8],
23965 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23966 let avail_len = __input.len();
23967 let mut payload_buf = [0; Self::ENCODED_LEN];
23968 let mut buf = if avail_len < Self::ENCODED_LEN {
23969 payload_buf[0..avail_len].copy_from_slice(__input);
23970 Bytes::new(&payload_buf)
23971 } else {
23972 Bytes::new(__input)
23973 };
23974 let mut __struct = Self::default();
23975 __struct.target_system = buf.get_u8()?;
23976 __struct.target_component = buf.get_u8()?;
23977 for v in &mut __struct.id_or_mac {
23978 let val = buf.get_u8()?;
23979 *v = val;
23980 }
23981 let tmp = buf.get_u8()?;
23982 __struct.operator_id_type =
23983 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23984 enum_type: "MavOdidOperatorIdType",
23985 value: tmp as u64,
23986 })?;
23987 let mut tmp = [0_u8; 20usize];
23988 for v in &mut tmp {
23989 *v = buf.get_u8()?;
23990 }
23991 __struct.operator_id = CharArray::new(tmp);
23992 Ok(__struct)
23993 }
23994 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23995 let mut __tmp = BytesMut::new(bytes);
23996 #[allow(clippy::absurd_extreme_comparisons)]
23997 #[allow(unused_comparisons)]
23998 if __tmp.remaining() < Self::ENCODED_LEN {
23999 panic!(
24000 "buffer is too small (need {} bytes, but got {})",
24001 Self::ENCODED_LEN,
24002 __tmp.remaining(),
24003 )
24004 }
24005 __tmp.put_u8(self.target_system);
24006 __tmp.put_u8(self.target_component);
24007 for val in &self.id_or_mac {
24008 __tmp.put_u8(*val);
24009 }
24010 __tmp.put_u8(self.operator_id_type as u8);
24011 for val in &self.operator_id {
24012 __tmp.put_u8(*val);
24013 }
24014 if matches!(version, MavlinkVersion::V2) {
24015 let len = __tmp.len();
24016 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24017 } else {
24018 __tmp.len()
24019 }
24020 }
24021}
24022#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
24023#[doc = ""]
24024#[doc = "ID: 12903"]
24025#[derive(Debug, Clone, PartialEq)]
24026#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24027#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24028#[cfg_attr(feature = "ts", derive(TS))]
24029#[cfg_attr(feature = "ts", ts(export))]
24030pub struct OPEN_DRONE_ID_SELF_ID_DATA {
24031 #[doc = "System ID (0 for broadcast)."]
24032 pub target_system: u8,
24033 #[doc = "Component ID (0 for broadcast)."]
24034 pub target_component: u8,
24035 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
24036 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24037 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24038 pub id_or_mac: [u8; 20],
24039 #[doc = "Indicates the type of the description field."]
24040 pub description_type: MavOdidDescType,
24041 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
24042 #[cfg_attr(feature = "ts", ts(type = "string"))]
24043 pub description: CharArray<23>,
24044}
24045impl OPEN_DRONE_ID_SELF_ID_DATA {
24046 pub const ENCODED_LEN: usize = 46usize;
24047 pub const DEFAULT: Self = Self {
24048 target_system: 0_u8,
24049 target_component: 0_u8,
24050 id_or_mac: [0_u8; 20usize],
24051 description_type: MavOdidDescType::DEFAULT,
24052 description: CharArray::new([0_u8; 23usize]),
24053 };
24054 #[cfg(feature = "arbitrary")]
24055 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24056 use arbitrary::{Arbitrary, Unstructured};
24057 let mut buf = [0u8; 1024];
24058 rng.fill_bytes(&mut buf);
24059 let mut unstructured = Unstructured::new(&buf);
24060 Self::arbitrary(&mut unstructured).unwrap_or_default()
24061 }
24062}
24063impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
24064 fn default() -> Self {
24065 Self::DEFAULT.clone()
24066 }
24067}
24068impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
24069 type Message = MavMessage;
24070 const ID: u32 = 12903u32;
24071 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
24072 const EXTRA_CRC: u8 = 249u8;
24073 const ENCODED_LEN: usize = 46usize;
24074 fn deser(
24075 _version: MavlinkVersion,
24076 __input: &[u8],
24077 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24078 let avail_len = __input.len();
24079 let mut payload_buf = [0; Self::ENCODED_LEN];
24080 let mut buf = if avail_len < Self::ENCODED_LEN {
24081 payload_buf[0..avail_len].copy_from_slice(__input);
24082 Bytes::new(&payload_buf)
24083 } else {
24084 Bytes::new(__input)
24085 };
24086 let mut __struct = Self::default();
24087 __struct.target_system = buf.get_u8()?;
24088 __struct.target_component = buf.get_u8()?;
24089 for v in &mut __struct.id_or_mac {
24090 let val = buf.get_u8()?;
24091 *v = val;
24092 }
24093 let tmp = buf.get_u8()?;
24094 __struct.description_type =
24095 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24096 enum_type: "MavOdidDescType",
24097 value: tmp as u64,
24098 })?;
24099 let mut tmp = [0_u8; 23usize];
24100 for v in &mut tmp {
24101 *v = buf.get_u8()?;
24102 }
24103 __struct.description = CharArray::new(tmp);
24104 Ok(__struct)
24105 }
24106 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24107 let mut __tmp = BytesMut::new(bytes);
24108 #[allow(clippy::absurd_extreme_comparisons)]
24109 #[allow(unused_comparisons)]
24110 if __tmp.remaining() < Self::ENCODED_LEN {
24111 panic!(
24112 "buffer is too small (need {} bytes, but got {})",
24113 Self::ENCODED_LEN,
24114 __tmp.remaining(),
24115 )
24116 }
24117 __tmp.put_u8(self.target_system);
24118 __tmp.put_u8(self.target_component);
24119 for val in &self.id_or_mac {
24120 __tmp.put_u8(*val);
24121 }
24122 __tmp.put_u8(self.description_type as u8);
24123 for val in &self.description {
24124 __tmp.put_u8(*val);
24125 }
24126 if matches!(version, MavlinkVersion::V2) {
24127 let len = __tmp.len();
24128 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24129 } else {
24130 __tmp.len()
24131 }
24132 }
24133}
24134#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
24135#[doc = ""]
24136#[doc = "ID: 12904"]
24137#[derive(Debug, Clone, PartialEq)]
24138#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24139#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24140#[cfg_attr(feature = "ts", derive(TS))]
24141#[cfg_attr(feature = "ts", ts(export))]
24142pub struct OPEN_DRONE_ID_SYSTEM_DATA {
24143 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
24144 pub operator_latitude: i32,
24145 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
24146 pub operator_longitude: i32,
24147 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
24148 pub area_ceiling: f32,
24149 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
24150 pub area_floor: f32,
24151 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
24152 pub operator_altitude_geo: f32,
24153 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
24154 pub timestamp: u32,
24155 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
24156 pub area_count: u16,
24157 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
24158 pub area_radius: u16,
24159 #[doc = "System ID (0 for broadcast)."]
24160 pub target_system: u8,
24161 #[doc = "Component ID (0 for broadcast)."]
24162 pub target_component: u8,
24163 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
24164 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24165 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24166 pub id_or_mac: [u8; 20],
24167 #[doc = "Specifies the operator location type."]
24168 pub operator_location_type: MavOdidOperatorLocationType,
24169 #[doc = "Specifies the classification type of the UA."]
24170 pub classification_type: MavOdidClassificationType,
24171 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
24172 pub category_eu: MavOdidCategoryEu,
24173 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
24174 pub class_eu: MavOdidClassEu,
24175}
24176impl OPEN_DRONE_ID_SYSTEM_DATA {
24177 pub const ENCODED_LEN: usize = 54usize;
24178 pub const DEFAULT: Self = Self {
24179 operator_latitude: 0_i32,
24180 operator_longitude: 0_i32,
24181 area_ceiling: 0.0_f32,
24182 area_floor: 0.0_f32,
24183 operator_altitude_geo: 0.0_f32,
24184 timestamp: 0_u32,
24185 area_count: 0_u16,
24186 area_radius: 0_u16,
24187 target_system: 0_u8,
24188 target_component: 0_u8,
24189 id_or_mac: [0_u8; 20usize],
24190 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
24191 classification_type: MavOdidClassificationType::DEFAULT,
24192 category_eu: MavOdidCategoryEu::DEFAULT,
24193 class_eu: MavOdidClassEu::DEFAULT,
24194 };
24195 #[cfg(feature = "arbitrary")]
24196 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24197 use arbitrary::{Arbitrary, Unstructured};
24198 let mut buf = [0u8; 1024];
24199 rng.fill_bytes(&mut buf);
24200 let mut unstructured = Unstructured::new(&buf);
24201 Self::arbitrary(&mut unstructured).unwrap_or_default()
24202 }
24203}
24204impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
24205 fn default() -> Self {
24206 Self::DEFAULT.clone()
24207 }
24208}
24209impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
24210 type Message = MavMessage;
24211 const ID: u32 = 12904u32;
24212 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
24213 const EXTRA_CRC: u8 = 77u8;
24214 const ENCODED_LEN: usize = 54usize;
24215 fn deser(
24216 _version: MavlinkVersion,
24217 __input: &[u8],
24218 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24219 let avail_len = __input.len();
24220 let mut payload_buf = [0; Self::ENCODED_LEN];
24221 let mut buf = if avail_len < Self::ENCODED_LEN {
24222 payload_buf[0..avail_len].copy_from_slice(__input);
24223 Bytes::new(&payload_buf)
24224 } else {
24225 Bytes::new(__input)
24226 };
24227 let mut __struct = Self::default();
24228 __struct.operator_latitude = buf.get_i32_le()?;
24229 __struct.operator_longitude = buf.get_i32_le()?;
24230 __struct.area_ceiling = buf.get_f32_le()?;
24231 __struct.area_floor = buf.get_f32_le()?;
24232 __struct.operator_altitude_geo = buf.get_f32_le()?;
24233 __struct.timestamp = buf.get_u32_le()?;
24234 __struct.area_count = buf.get_u16_le()?;
24235 __struct.area_radius = buf.get_u16_le()?;
24236 __struct.target_system = buf.get_u8()?;
24237 __struct.target_component = buf.get_u8()?;
24238 for v in &mut __struct.id_or_mac {
24239 let val = buf.get_u8()?;
24240 *v = val;
24241 }
24242 let tmp = buf.get_u8()?;
24243 __struct.operator_location_type =
24244 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24245 enum_type: "MavOdidOperatorLocationType",
24246 value: tmp as u64,
24247 })?;
24248 let tmp = buf.get_u8()?;
24249 __struct.classification_type =
24250 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24251 enum_type: "MavOdidClassificationType",
24252 value: tmp as u64,
24253 })?;
24254 let tmp = buf.get_u8()?;
24255 __struct.category_eu =
24256 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24257 enum_type: "MavOdidCategoryEu",
24258 value: tmp as u64,
24259 })?;
24260 let tmp = buf.get_u8()?;
24261 __struct.class_eu =
24262 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24263 enum_type: "MavOdidClassEu",
24264 value: tmp as u64,
24265 })?;
24266 Ok(__struct)
24267 }
24268 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24269 let mut __tmp = BytesMut::new(bytes);
24270 #[allow(clippy::absurd_extreme_comparisons)]
24271 #[allow(unused_comparisons)]
24272 if __tmp.remaining() < Self::ENCODED_LEN {
24273 panic!(
24274 "buffer is too small (need {} bytes, but got {})",
24275 Self::ENCODED_LEN,
24276 __tmp.remaining(),
24277 )
24278 }
24279 __tmp.put_i32_le(self.operator_latitude);
24280 __tmp.put_i32_le(self.operator_longitude);
24281 __tmp.put_f32_le(self.area_ceiling);
24282 __tmp.put_f32_le(self.area_floor);
24283 __tmp.put_f32_le(self.operator_altitude_geo);
24284 __tmp.put_u32_le(self.timestamp);
24285 __tmp.put_u16_le(self.area_count);
24286 __tmp.put_u16_le(self.area_radius);
24287 __tmp.put_u8(self.target_system);
24288 __tmp.put_u8(self.target_component);
24289 for val in &self.id_or_mac {
24290 __tmp.put_u8(*val);
24291 }
24292 __tmp.put_u8(self.operator_location_type as u8);
24293 __tmp.put_u8(self.classification_type as u8);
24294 __tmp.put_u8(self.category_eu as u8);
24295 __tmp.put_u8(self.class_eu as u8);
24296 if matches!(version, MavlinkVersion::V2) {
24297 let len = __tmp.len();
24298 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24299 } else {
24300 __tmp.len()
24301 }
24302 }
24303}
24304#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
24305#[doc = ""]
24306#[doc = "ID: 12919"]
24307#[derive(Debug, Clone, PartialEq)]
24308#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24309#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24310#[cfg_attr(feature = "ts", derive(TS))]
24311#[cfg_attr(feature = "ts", ts(export))]
24312pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
24313 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
24314 pub operator_latitude: i32,
24315 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
24316 pub operator_longitude: i32,
24317 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
24318 pub operator_altitude_geo: f32,
24319 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
24320 pub timestamp: u32,
24321 #[doc = "System ID (0 for broadcast)."]
24322 pub target_system: u8,
24323 #[doc = "Component ID (0 for broadcast)."]
24324 pub target_component: u8,
24325}
24326impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
24327 pub const ENCODED_LEN: usize = 18usize;
24328 pub const DEFAULT: Self = Self {
24329 operator_latitude: 0_i32,
24330 operator_longitude: 0_i32,
24331 operator_altitude_geo: 0.0_f32,
24332 timestamp: 0_u32,
24333 target_system: 0_u8,
24334 target_component: 0_u8,
24335 };
24336 #[cfg(feature = "arbitrary")]
24337 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24338 use arbitrary::{Arbitrary, Unstructured};
24339 let mut buf = [0u8; 1024];
24340 rng.fill_bytes(&mut buf);
24341 let mut unstructured = Unstructured::new(&buf);
24342 Self::arbitrary(&mut unstructured).unwrap_or_default()
24343 }
24344}
24345impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
24346 fn default() -> Self {
24347 Self::DEFAULT.clone()
24348 }
24349}
24350impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
24351 type Message = MavMessage;
24352 const ID: u32 = 12919u32;
24353 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
24354 const EXTRA_CRC: u8 = 7u8;
24355 const ENCODED_LEN: usize = 18usize;
24356 fn deser(
24357 _version: MavlinkVersion,
24358 __input: &[u8],
24359 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24360 let avail_len = __input.len();
24361 let mut payload_buf = [0; Self::ENCODED_LEN];
24362 let mut buf = if avail_len < Self::ENCODED_LEN {
24363 payload_buf[0..avail_len].copy_from_slice(__input);
24364 Bytes::new(&payload_buf)
24365 } else {
24366 Bytes::new(__input)
24367 };
24368 let mut __struct = Self::default();
24369 __struct.operator_latitude = buf.get_i32_le()?;
24370 __struct.operator_longitude = buf.get_i32_le()?;
24371 __struct.operator_altitude_geo = buf.get_f32_le()?;
24372 __struct.timestamp = buf.get_u32_le()?;
24373 __struct.target_system = buf.get_u8()?;
24374 __struct.target_component = buf.get_u8()?;
24375 Ok(__struct)
24376 }
24377 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24378 let mut __tmp = BytesMut::new(bytes);
24379 #[allow(clippy::absurd_extreme_comparisons)]
24380 #[allow(unused_comparisons)]
24381 if __tmp.remaining() < Self::ENCODED_LEN {
24382 panic!(
24383 "buffer is too small (need {} bytes, but got {})",
24384 Self::ENCODED_LEN,
24385 __tmp.remaining(),
24386 )
24387 }
24388 __tmp.put_i32_le(self.operator_latitude);
24389 __tmp.put_i32_le(self.operator_longitude);
24390 __tmp.put_f32_le(self.operator_altitude_geo);
24391 __tmp.put_u32_le(self.timestamp);
24392 __tmp.put_u8(self.target_system);
24393 __tmp.put_u8(self.target_component);
24394 if matches!(version, MavlinkVersion::V2) {
24395 let len = __tmp.len();
24396 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24397 } else {
24398 __tmp.len()
24399 }
24400 }
24401}
24402#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
24403#[doc = ""]
24404#[doc = "ID: 100"]
24405#[derive(Debug, Clone, PartialEq)]
24406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24408#[cfg_attr(feature = "ts", derive(TS))]
24409#[cfg_attr(feature = "ts", ts(export))]
24410pub struct OPTICAL_FLOW_DATA {
24411 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24412 pub time_usec: u64,
24413 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
24414 pub flow_comp_m_x: f32,
24415 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
24416 pub flow_comp_m_y: f32,
24417 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
24418 pub ground_distance: f32,
24419 #[doc = "Flow in x-sensor direction"]
24420 pub flow_x: i16,
24421 #[doc = "Flow in y-sensor direction"]
24422 pub flow_y: i16,
24423 #[doc = "Sensor ID"]
24424 pub sensor_id: u8,
24425 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
24426 pub quality: u8,
24427 #[doc = "Flow rate about X axis"]
24428 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24429 pub flow_rate_x: f32,
24430 #[doc = "Flow rate about Y axis"]
24431 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24432 pub flow_rate_y: f32,
24433}
24434impl OPTICAL_FLOW_DATA {
24435 pub const ENCODED_LEN: usize = 34usize;
24436 pub const DEFAULT: Self = Self {
24437 time_usec: 0_u64,
24438 flow_comp_m_x: 0.0_f32,
24439 flow_comp_m_y: 0.0_f32,
24440 ground_distance: 0.0_f32,
24441 flow_x: 0_i16,
24442 flow_y: 0_i16,
24443 sensor_id: 0_u8,
24444 quality: 0_u8,
24445 flow_rate_x: 0.0_f32,
24446 flow_rate_y: 0.0_f32,
24447 };
24448 #[cfg(feature = "arbitrary")]
24449 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24450 use arbitrary::{Arbitrary, Unstructured};
24451 let mut buf = [0u8; 1024];
24452 rng.fill_bytes(&mut buf);
24453 let mut unstructured = Unstructured::new(&buf);
24454 Self::arbitrary(&mut unstructured).unwrap_or_default()
24455 }
24456}
24457impl Default for OPTICAL_FLOW_DATA {
24458 fn default() -> Self {
24459 Self::DEFAULT.clone()
24460 }
24461}
24462impl MessageData for OPTICAL_FLOW_DATA {
24463 type Message = MavMessage;
24464 const ID: u32 = 100u32;
24465 const NAME: &'static str = "OPTICAL_FLOW";
24466 const EXTRA_CRC: u8 = 175u8;
24467 const ENCODED_LEN: usize = 34usize;
24468 fn deser(
24469 _version: MavlinkVersion,
24470 __input: &[u8],
24471 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24472 let avail_len = __input.len();
24473 let mut payload_buf = [0; Self::ENCODED_LEN];
24474 let mut buf = if avail_len < Self::ENCODED_LEN {
24475 payload_buf[0..avail_len].copy_from_slice(__input);
24476 Bytes::new(&payload_buf)
24477 } else {
24478 Bytes::new(__input)
24479 };
24480 let mut __struct = Self::default();
24481 __struct.time_usec = buf.get_u64_le()?;
24482 __struct.flow_comp_m_x = buf.get_f32_le()?;
24483 __struct.flow_comp_m_y = buf.get_f32_le()?;
24484 __struct.ground_distance = buf.get_f32_le()?;
24485 __struct.flow_x = buf.get_i16_le()?;
24486 __struct.flow_y = buf.get_i16_le()?;
24487 __struct.sensor_id = buf.get_u8()?;
24488 __struct.quality = buf.get_u8()?;
24489 __struct.flow_rate_x = buf.get_f32_le()?;
24490 __struct.flow_rate_y = buf.get_f32_le()?;
24491 Ok(__struct)
24492 }
24493 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24494 let mut __tmp = BytesMut::new(bytes);
24495 #[allow(clippy::absurd_extreme_comparisons)]
24496 #[allow(unused_comparisons)]
24497 if __tmp.remaining() < Self::ENCODED_LEN {
24498 panic!(
24499 "buffer is too small (need {} bytes, but got {})",
24500 Self::ENCODED_LEN,
24501 __tmp.remaining(),
24502 )
24503 }
24504 __tmp.put_u64_le(self.time_usec);
24505 __tmp.put_f32_le(self.flow_comp_m_x);
24506 __tmp.put_f32_le(self.flow_comp_m_y);
24507 __tmp.put_f32_le(self.ground_distance);
24508 __tmp.put_i16_le(self.flow_x);
24509 __tmp.put_i16_le(self.flow_y);
24510 __tmp.put_u8(self.sensor_id);
24511 __tmp.put_u8(self.quality);
24512 if matches!(version, MavlinkVersion::V2) {
24513 __tmp.put_f32_le(self.flow_rate_x);
24514 __tmp.put_f32_le(self.flow_rate_y);
24515 let len = __tmp.len();
24516 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24517 } else {
24518 __tmp.len()
24519 }
24520 }
24521}
24522#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
24523#[doc = ""]
24524#[doc = "ID: 106"]
24525#[derive(Debug, Clone, PartialEq)]
24526#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24527#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24528#[cfg_attr(feature = "ts", derive(TS))]
24529#[cfg_attr(feature = "ts", ts(export))]
24530pub struct OPTICAL_FLOW_RAD_DATA {
24531 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24532 pub time_usec: u64,
24533 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
24534 pub integration_time_us: u32,
24535 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
24536 pub integrated_x: f32,
24537 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
24538 pub integrated_y: f32,
24539 #[doc = "RH rotation around X axis"]
24540 pub integrated_xgyro: f32,
24541 #[doc = "RH rotation around Y axis"]
24542 pub integrated_ygyro: f32,
24543 #[doc = "RH rotation around Z axis"]
24544 pub integrated_zgyro: f32,
24545 #[doc = "Time since the distance was sampled."]
24546 pub time_delta_distance_us: u32,
24547 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
24548 pub distance: f32,
24549 #[doc = "Temperature"]
24550 pub temperature: i16,
24551 #[doc = "Sensor ID"]
24552 pub sensor_id: u8,
24553 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
24554 pub quality: u8,
24555}
24556impl OPTICAL_FLOW_RAD_DATA {
24557 pub const ENCODED_LEN: usize = 44usize;
24558 pub const DEFAULT: Self = Self {
24559 time_usec: 0_u64,
24560 integration_time_us: 0_u32,
24561 integrated_x: 0.0_f32,
24562 integrated_y: 0.0_f32,
24563 integrated_xgyro: 0.0_f32,
24564 integrated_ygyro: 0.0_f32,
24565 integrated_zgyro: 0.0_f32,
24566 time_delta_distance_us: 0_u32,
24567 distance: 0.0_f32,
24568 temperature: 0_i16,
24569 sensor_id: 0_u8,
24570 quality: 0_u8,
24571 };
24572 #[cfg(feature = "arbitrary")]
24573 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24574 use arbitrary::{Arbitrary, Unstructured};
24575 let mut buf = [0u8; 1024];
24576 rng.fill_bytes(&mut buf);
24577 let mut unstructured = Unstructured::new(&buf);
24578 Self::arbitrary(&mut unstructured).unwrap_or_default()
24579 }
24580}
24581impl Default for OPTICAL_FLOW_RAD_DATA {
24582 fn default() -> Self {
24583 Self::DEFAULT.clone()
24584 }
24585}
24586impl MessageData for OPTICAL_FLOW_RAD_DATA {
24587 type Message = MavMessage;
24588 const ID: u32 = 106u32;
24589 const NAME: &'static str = "OPTICAL_FLOW_RAD";
24590 const EXTRA_CRC: u8 = 138u8;
24591 const ENCODED_LEN: usize = 44usize;
24592 fn deser(
24593 _version: MavlinkVersion,
24594 __input: &[u8],
24595 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24596 let avail_len = __input.len();
24597 let mut payload_buf = [0; Self::ENCODED_LEN];
24598 let mut buf = if avail_len < Self::ENCODED_LEN {
24599 payload_buf[0..avail_len].copy_from_slice(__input);
24600 Bytes::new(&payload_buf)
24601 } else {
24602 Bytes::new(__input)
24603 };
24604 let mut __struct = Self::default();
24605 __struct.time_usec = buf.get_u64_le()?;
24606 __struct.integration_time_us = buf.get_u32_le()?;
24607 __struct.integrated_x = buf.get_f32_le()?;
24608 __struct.integrated_y = buf.get_f32_le()?;
24609 __struct.integrated_xgyro = buf.get_f32_le()?;
24610 __struct.integrated_ygyro = buf.get_f32_le()?;
24611 __struct.integrated_zgyro = buf.get_f32_le()?;
24612 __struct.time_delta_distance_us = buf.get_u32_le()?;
24613 __struct.distance = buf.get_f32_le()?;
24614 __struct.temperature = buf.get_i16_le()?;
24615 __struct.sensor_id = buf.get_u8()?;
24616 __struct.quality = buf.get_u8()?;
24617 Ok(__struct)
24618 }
24619 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24620 let mut __tmp = BytesMut::new(bytes);
24621 #[allow(clippy::absurd_extreme_comparisons)]
24622 #[allow(unused_comparisons)]
24623 if __tmp.remaining() < Self::ENCODED_LEN {
24624 panic!(
24625 "buffer is too small (need {} bytes, but got {})",
24626 Self::ENCODED_LEN,
24627 __tmp.remaining(),
24628 )
24629 }
24630 __tmp.put_u64_le(self.time_usec);
24631 __tmp.put_u32_le(self.integration_time_us);
24632 __tmp.put_f32_le(self.integrated_x);
24633 __tmp.put_f32_le(self.integrated_y);
24634 __tmp.put_f32_le(self.integrated_xgyro);
24635 __tmp.put_f32_le(self.integrated_ygyro);
24636 __tmp.put_f32_le(self.integrated_zgyro);
24637 __tmp.put_u32_le(self.time_delta_distance_us);
24638 __tmp.put_f32_le(self.distance);
24639 __tmp.put_i16_le(self.temperature);
24640 __tmp.put_u8(self.sensor_id);
24641 __tmp.put_u8(self.quality);
24642 if matches!(version, MavlinkVersion::V2) {
24643 let len = __tmp.len();
24644 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24645 } else {
24646 __tmp.len()
24647 }
24648 }
24649}
24650#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
24651#[doc = ""]
24652#[doc = "ID: 360"]
24653#[derive(Debug, Clone, PartialEq)]
24654#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24655#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24656#[cfg_attr(feature = "ts", derive(TS))]
24657#[cfg_attr(feature = "ts", ts(export))]
24658pub struct ORBIT_EXECUTION_STATUS_DATA {
24659 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24660 pub time_usec: u64,
24661 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
24662 pub radius: f32,
24663 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
24664 pub x: i32,
24665 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
24666 pub y: i32,
24667 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
24668 pub z: f32,
24669 #[doc = "The coordinate system of the fields: x, y, z."]
24670 pub frame: MavFrame,
24671}
24672impl ORBIT_EXECUTION_STATUS_DATA {
24673 pub const ENCODED_LEN: usize = 25usize;
24674 pub const DEFAULT: Self = Self {
24675 time_usec: 0_u64,
24676 radius: 0.0_f32,
24677 x: 0_i32,
24678 y: 0_i32,
24679 z: 0.0_f32,
24680 frame: MavFrame::DEFAULT,
24681 };
24682 #[cfg(feature = "arbitrary")]
24683 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24684 use arbitrary::{Arbitrary, Unstructured};
24685 let mut buf = [0u8; 1024];
24686 rng.fill_bytes(&mut buf);
24687 let mut unstructured = Unstructured::new(&buf);
24688 Self::arbitrary(&mut unstructured).unwrap_or_default()
24689 }
24690}
24691impl Default for ORBIT_EXECUTION_STATUS_DATA {
24692 fn default() -> Self {
24693 Self::DEFAULT.clone()
24694 }
24695}
24696impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
24697 type Message = MavMessage;
24698 const ID: u32 = 360u32;
24699 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
24700 const EXTRA_CRC: u8 = 11u8;
24701 const ENCODED_LEN: usize = 25usize;
24702 fn deser(
24703 _version: MavlinkVersion,
24704 __input: &[u8],
24705 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24706 let avail_len = __input.len();
24707 let mut payload_buf = [0; Self::ENCODED_LEN];
24708 let mut buf = if avail_len < Self::ENCODED_LEN {
24709 payload_buf[0..avail_len].copy_from_slice(__input);
24710 Bytes::new(&payload_buf)
24711 } else {
24712 Bytes::new(__input)
24713 };
24714 let mut __struct = Self::default();
24715 __struct.time_usec = buf.get_u64_le()?;
24716 __struct.radius = buf.get_f32_le()?;
24717 __struct.x = buf.get_i32_le()?;
24718 __struct.y = buf.get_i32_le()?;
24719 __struct.z = buf.get_f32_le()?;
24720 let tmp = buf.get_u8()?;
24721 __struct.frame =
24722 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24723 enum_type: "MavFrame",
24724 value: tmp as u64,
24725 })?;
24726 Ok(__struct)
24727 }
24728 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24729 let mut __tmp = BytesMut::new(bytes);
24730 #[allow(clippy::absurd_extreme_comparisons)]
24731 #[allow(unused_comparisons)]
24732 if __tmp.remaining() < Self::ENCODED_LEN {
24733 panic!(
24734 "buffer is too small (need {} bytes, but got {})",
24735 Self::ENCODED_LEN,
24736 __tmp.remaining(),
24737 )
24738 }
24739 __tmp.put_u64_le(self.time_usec);
24740 __tmp.put_f32_le(self.radius);
24741 __tmp.put_i32_le(self.x);
24742 __tmp.put_i32_le(self.y);
24743 __tmp.put_f32_le(self.z);
24744 __tmp.put_u8(self.frame as u8);
24745 if matches!(version, MavlinkVersion::V2) {
24746 let len = __tmp.len();
24747 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24748 } else {
24749 __tmp.len()
24750 }
24751 }
24752}
24753#[doc = "Response from a PARAM_EXT_SET message."]
24754#[doc = ""]
24755#[doc = "ID: 324"]
24756#[derive(Debug, Clone, PartialEq)]
24757#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24758#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24759#[cfg_attr(feature = "ts", derive(TS))]
24760#[cfg_attr(feature = "ts", ts(export))]
24761pub struct PARAM_EXT_ACK_DATA {
24762 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24763 #[cfg_attr(feature = "ts", ts(type = "string"))]
24764 pub param_id: CharArray<16>,
24765 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
24766 #[cfg_attr(feature = "ts", ts(type = "string"))]
24767 pub param_value: CharArray<128>,
24768 #[doc = "Parameter type."]
24769 pub param_type: MavParamExtType,
24770 #[doc = "Result code."]
24771 pub param_result: ParamAck,
24772}
24773impl PARAM_EXT_ACK_DATA {
24774 pub const ENCODED_LEN: usize = 146usize;
24775 pub const DEFAULT: Self = Self {
24776 param_id: CharArray::new([0_u8; 16usize]),
24777 param_value: CharArray::new([0_u8; 128usize]),
24778 param_type: MavParamExtType::DEFAULT,
24779 param_result: ParamAck::DEFAULT,
24780 };
24781 #[cfg(feature = "arbitrary")]
24782 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24783 use arbitrary::{Arbitrary, Unstructured};
24784 let mut buf = [0u8; 1024];
24785 rng.fill_bytes(&mut buf);
24786 let mut unstructured = Unstructured::new(&buf);
24787 Self::arbitrary(&mut unstructured).unwrap_or_default()
24788 }
24789}
24790impl Default for PARAM_EXT_ACK_DATA {
24791 fn default() -> Self {
24792 Self::DEFAULT.clone()
24793 }
24794}
24795impl MessageData for PARAM_EXT_ACK_DATA {
24796 type Message = MavMessage;
24797 const ID: u32 = 324u32;
24798 const NAME: &'static str = "PARAM_EXT_ACK";
24799 const EXTRA_CRC: u8 = 132u8;
24800 const ENCODED_LEN: usize = 146usize;
24801 fn deser(
24802 _version: MavlinkVersion,
24803 __input: &[u8],
24804 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24805 let avail_len = __input.len();
24806 let mut payload_buf = [0; Self::ENCODED_LEN];
24807 let mut buf = if avail_len < Self::ENCODED_LEN {
24808 payload_buf[0..avail_len].copy_from_slice(__input);
24809 Bytes::new(&payload_buf)
24810 } else {
24811 Bytes::new(__input)
24812 };
24813 let mut __struct = Self::default();
24814 let mut tmp = [0_u8; 16usize];
24815 for v in &mut tmp {
24816 *v = buf.get_u8()?;
24817 }
24818 __struct.param_id = CharArray::new(tmp);
24819 let mut tmp = [0_u8; 128usize];
24820 for v in &mut tmp {
24821 *v = buf.get_u8()?;
24822 }
24823 __struct.param_value = CharArray::new(tmp);
24824 let tmp = buf.get_u8()?;
24825 __struct.param_type =
24826 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24827 enum_type: "MavParamExtType",
24828 value: tmp as u64,
24829 })?;
24830 let tmp = buf.get_u8()?;
24831 __struct.param_result =
24832 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24833 enum_type: "ParamAck",
24834 value: tmp as u64,
24835 })?;
24836 Ok(__struct)
24837 }
24838 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24839 let mut __tmp = BytesMut::new(bytes);
24840 #[allow(clippy::absurd_extreme_comparisons)]
24841 #[allow(unused_comparisons)]
24842 if __tmp.remaining() < Self::ENCODED_LEN {
24843 panic!(
24844 "buffer is too small (need {} bytes, but got {})",
24845 Self::ENCODED_LEN,
24846 __tmp.remaining(),
24847 )
24848 }
24849 for val in &self.param_id {
24850 __tmp.put_u8(*val);
24851 }
24852 for val in &self.param_value {
24853 __tmp.put_u8(*val);
24854 }
24855 __tmp.put_u8(self.param_type as u8);
24856 __tmp.put_u8(self.param_result as u8);
24857 if matches!(version, MavlinkVersion::V2) {
24858 let len = __tmp.len();
24859 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24860 } else {
24861 __tmp.len()
24862 }
24863 }
24864}
24865#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
24866#[doc = ""]
24867#[doc = "ID: 321"]
24868#[derive(Debug, Clone, PartialEq)]
24869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24870#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24871#[cfg_attr(feature = "ts", derive(TS))]
24872#[cfg_attr(feature = "ts", ts(export))]
24873pub struct PARAM_EXT_REQUEST_LIST_DATA {
24874 #[doc = "System ID"]
24875 pub target_system: u8,
24876 #[doc = "Component ID"]
24877 pub target_component: u8,
24878}
24879impl PARAM_EXT_REQUEST_LIST_DATA {
24880 pub const ENCODED_LEN: usize = 2usize;
24881 pub const DEFAULT: Self = Self {
24882 target_system: 0_u8,
24883 target_component: 0_u8,
24884 };
24885 #[cfg(feature = "arbitrary")]
24886 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24887 use arbitrary::{Arbitrary, Unstructured};
24888 let mut buf = [0u8; 1024];
24889 rng.fill_bytes(&mut buf);
24890 let mut unstructured = Unstructured::new(&buf);
24891 Self::arbitrary(&mut unstructured).unwrap_or_default()
24892 }
24893}
24894impl Default for PARAM_EXT_REQUEST_LIST_DATA {
24895 fn default() -> Self {
24896 Self::DEFAULT.clone()
24897 }
24898}
24899impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
24900 type Message = MavMessage;
24901 const ID: u32 = 321u32;
24902 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
24903 const EXTRA_CRC: u8 = 88u8;
24904 const ENCODED_LEN: usize = 2usize;
24905 fn deser(
24906 _version: MavlinkVersion,
24907 __input: &[u8],
24908 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24909 let avail_len = __input.len();
24910 let mut payload_buf = [0; Self::ENCODED_LEN];
24911 let mut buf = if avail_len < Self::ENCODED_LEN {
24912 payload_buf[0..avail_len].copy_from_slice(__input);
24913 Bytes::new(&payload_buf)
24914 } else {
24915 Bytes::new(__input)
24916 };
24917 let mut __struct = Self::default();
24918 __struct.target_system = buf.get_u8()?;
24919 __struct.target_component = buf.get_u8()?;
24920 Ok(__struct)
24921 }
24922 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24923 let mut __tmp = BytesMut::new(bytes);
24924 #[allow(clippy::absurd_extreme_comparisons)]
24925 #[allow(unused_comparisons)]
24926 if __tmp.remaining() < Self::ENCODED_LEN {
24927 panic!(
24928 "buffer is too small (need {} bytes, but got {})",
24929 Self::ENCODED_LEN,
24930 __tmp.remaining(),
24931 )
24932 }
24933 __tmp.put_u8(self.target_system);
24934 __tmp.put_u8(self.target_component);
24935 if matches!(version, MavlinkVersion::V2) {
24936 let len = __tmp.len();
24937 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24938 } else {
24939 __tmp.len()
24940 }
24941 }
24942}
24943#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
24944#[doc = ""]
24945#[doc = "ID: 320"]
24946#[derive(Debug, Clone, PartialEq)]
24947#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24948#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24949#[cfg_attr(feature = "ts", derive(TS))]
24950#[cfg_attr(feature = "ts", ts(export))]
24951pub struct PARAM_EXT_REQUEST_READ_DATA {
24952 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
24953 pub param_index: i16,
24954 #[doc = "System ID"]
24955 pub target_system: u8,
24956 #[doc = "Component ID"]
24957 pub target_component: u8,
24958 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24959 #[cfg_attr(feature = "ts", ts(type = "string"))]
24960 pub param_id: CharArray<16>,
24961}
24962impl PARAM_EXT_REQUEST_READ_DATA {
24963 pub const ENCODED_LEN: usize = 20usize;
24964 pub const DEFAULT: Self = Self {
24965 param_index: 0_i16,
24966 target_system: 0_u8,
24967 target_component: 0_u8,
24968 param_id: CharArray::new([0_u8; 16usize]),
24969 };
24970 #[cfg(feature = "arbitrary")]
24971 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24972 use arbitrary::{Arbitrary, Unstructured};
24973 let mut buf = [0u8; 1024];
24974 rng.fill_bytes(&mut buf);
24975 let mut unstructured = Unstructured::new(&buf);
24976 Self::arbitrary(&mut unstructured).unwrap_or_default()
24977 }
24978}
24979impl Default for PARAM_EXT_REQUEST_READ_DATA {
24980 fn default() -> Self {
24981 Self::DEFAULT.clone()
24982 }
24983}
24984impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
24985 type Message = MavMessage;
24986 const ID: u32 = 320u32;
24987 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
24988 const EXTRA_CRC: u8 = 243u8;
24989 const ENCODED_LEN: usize = 20usize;
24990 fn deser(
24991 _version: MavlinkVersion,
24992 __input: &[u8],
24993 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24994 let avail_len = __input.len();
24995 let mut payload_buf = [0; Self::ENCODED_LEN];
24996 let mut buf = if avail_len < Self::ENCODED_LEN {
24997 payload_buf[0..avail_len].copy_from_slice(__input);
24998 Bytes::new(&payload_buf)
24999 } else {
25000 Bytes::new(__input)
25001 };
25002 let mut __struct = Self::default();
25003 __struct.param_index = buf.get_i16_le()?;
25004 __struct.target_system = buf.get_u8()?;
25005 __struct.target_component = buf.get_u8()?;
25006 let mut tmp = [0_u8; 16usize];
25007 for v in &mut tmp {
25008 *v = buf.get_u8()?;
25009 }
25010 __struct.param_id = CharArray::new(tmp);
25011 Ok(__struct)
25012 }
25013 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25014 let mut __tmp = BytesMut::new(bytes);
25015 #[allow(clippy::absurd_extreme_comparisons)]
25016 #[allow(unused_comparisons)]
25017 if __tmp.remaining() < Self::ENCODED_LEN {
25018 panic!(
25019 "buffer is too small (need {} bytes, but got {})",
25020 Self::ENCODED_LEN,
25021 __tmp.remaining(),
25022 )
25023 }
25024 __tmp.put_i16_le(self.param_index);
25025 __tmp.put_u8(self.target_system);
25026 __tmp.put_u8(self.target_component);
25027 for val in &self.param_id {
25028 __tmp.put_u8(*val);
25029 }
25030 if matches!(version, MavlinkVersion::V2) {
25031 let len = __tmp.len();
25032 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25033 } else {
25034 __tmp.len()
25035 }
25036 }
25037}
25038#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
25039#[doc = ""]
25040#[doc = "ID: 323"]
25041#[derive(Debug, Clone, PartialEq)]
25042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25043#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25044#[cfg_attr(feature = "ts", derive(TS))]
25045#[cfg_attr(feature = "ts", ts(export))]
25046pub struct PARAM_EXT_SET_DATA {
25047 #[doc = "System ID"]
25048 pub target_system: u8,
25049 #[doc = "Component ID"]
25050 pub target_component: u8,
25051 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
25052 #[cfg_attr(feature = "ts", ts(type = "string"))]
25053 pub param_id: CharArray<16>,
25054 #[doc = "Parameter value"]
25055 #[cfg_attr(feature = "ts", ts(type = "string"))]
25056 pub param_value: CharArray<128>,
25057 #[doc = "Parameter type."]
25058 pub param_type: MavParamExtType,
25059}
25060impl PARAM_EXT_SET_DATA {
25061 pub const ENCODED_LEN: usize = 147usize;
25062 pub const DEFAULT: Self = Self {
25063 target_system: 0_u8,
25064 target_component: 0_u8,
25065 param_id: CharArray::new([0_u8; 16usize]),
25066 param_value: CharArray::new([0_u8; 128usize]),
25067 param_type: MavParamExtType::DEFAULT,
25068 };
25069 #[cfg(feature = "arbitrary")]
25070 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25071 use arbitrary::{Arbitrary, Unstructured};
25072 let mut buf = [0u8; 1024];
25073 rng.fill_bytes(&mut buf);
25074 let mut unstructured = Unstructured::new(&buf);
25075 Self::arbitrary(&mut unstructured).unwrap_or_default()
25076 }
25077}
25078impl Default for PARAM_EXT_SET_DATA {
25079 fn default() -> Self {
25080 Self::DEFAULT.clone()
25081 }
25082}
25083impl MessageData for PARAM_EXT_SET_DATA {
25084 type Message = MavMessage;
25085 const ID: u32 = 323u32;
25086 const NAME: &'static str = "PARAM_EXT_SET";
25087 const EXTRA_CRC: u8 = 78u8;
25088 const ENCODED_LEN: usize = 147usize;
25089 fn deser(
25090 _version: MavlinkVersion,
25091 __input: &[u8],
25092 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25093 let avail_len = __input.len();
25094 let mut payload_buf = [0; Self::ENCODED_LEN];
25095 let mut buf = if avail_len < Self::ENCODED_LEN {
25096 payload_buf[0..avail_len].copy_from_slice(__input);
25097 Bytes::new(&payload_buf)
25098 } else {
25099 Bytes::new(__input)
25100 };
25101 let mut __struct = Self::default();
25102 __struct.target_system = buf.get_u8()?;
25103 __struct.target_component = buf.get_u8()?;
25104 let mut tmp = [0_u8; 16usize];
25105 for v in &mut tmp {
25106 *v = buf.get_u8()?;
25107 }
25108 __struct.param_id = CharArray::new(tmp);
25109 let mut tmp = [0_u8; 128usize];
25110 for v in &mut tmp {
25111 *v = buf.get_u8()?;
25112 }
25113 __struct.param_value = CharArray::new(tmp);
25114 let tmp = buf.get_u8()?;
25115 __struct.param_type =
25116 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25117 enum_type: "MavParamExtType",
25118 value: tmp as u64,
25119 })?;
25120 Ok(__struct)
25121 }
25122 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25123 let mut __tmp = BytesMut::new(bytes);
25124 #[allow(clippy::absurd_extreme_comparisons)]
25125 #[allow(unused_comparisons)]
25126 if __tmp.remaining() < Self::ENCODED_LEN {
25127 panic!(
25128 "buffer is too small (need {} bytes, but got {})",
25129 Self::ENCODED_LEN,
25130 __tmp.remaining(),
25131 )
25132 }
25133 __tmp.put_u8(self.target_system);
25134 __tmp.put_u8(self.target_component);
25135 for val in &self.param_id {
25136 __tmp.put_u8(*val);
25137 }
25138 for val in &self.param_value {
25139 __tmp.put_u8(*val);
25140 }
25141 __tmp.put_u8(self.param_type as u8);
25142 if matches!(version, MavlinkVersion::V2) {
25143 let len = __tmp.len();
25144 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25145 } else {
25146 __tmp.len()
25147 }
25148 }
25149}
25150#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
25151#[doc = ""]
25152#[doc = "ID: 322"]
25153#[derive(Debug, Clone, PartialEq)]
25154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25155#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25156#[cfg_attr(feature = "ts", derive(TS))]
25157#[cfg_attr(feature = "ts", ts(export))]
25158pub struct PARAM_EXT_VALUE_DATA {
25159 #[doc = "Total number of parameters"]
25160 pub param_count: u16,
25161 #[doc = "Index of this parameter"]
25162 pub param_index: u16,
25163 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
25164 #[cfg_attr(feature = "ts", ts(type = "string"))]
25165 pub param_id: CharArray<16>,
25166 #[doc = "Parameter value"]
25167 #[cfg_attr(feature = "ts", ts(type = "string"))]
25168 pub param_value: CharArray<128>,
25169 #[doc = "Parameter type."]
25170 pub param_type: MavParamExtType,
25171}
25172impl PARAM_EXT_VALUE_DATA {
25173 pub const ENCODED_LEN: usize = 149usize;
25174 pub const DEFAULT: Self = Self {
25175 param_count: 0_u16,
25176 param_index: 0_u16,
25177 param_id: CharArray::new([0_u8; 16usize]),
25178 param_value: CharArray::new([0_u8; 128usize]),
25179 param_type: MavParamExtType::DEFAULT,
25180 };
25181 #[cfg(feature = "arbitrary")]
25182 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25183 use arbitrary::{Arbitrary, Unstructured};
25184 let mut buf = [0u8; 1024];
25185 rng.fill_bytes(&mut buf);
25186 let mut unstructured = Unstructured::new(&buf);
25187 Self::arbitrary(&mut unstructured).unwrap_or_default()
25188 }
25189}
25190impl Default for PARAM_EXT_VALUE_DATA {
25191 fn default() -> Self {
25192 Self::DEFAULT.clone()
25193 }
25194}
25195impl MessageData for PARAM_EXT_VALUE_DATA {
25196 type Message = MavMessage;
25197 const ID: u32 = 322u32;
25198 const NAME: &'static str = "PARAM_EXT_VALUE";
25199 const EXTRA_CRC: u8 = 243u8;
25200 const ENCODED_LEN: usize = 149usize;
25201 fn deser(
25202 _version: MavlinkVersion,
25203 __input: &[u8],
25204 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25205 let avail_len = __input.len();
25206 let mut payload_buf = [0; Self::ENCODED_LEN];
25207 let mut buf = if avail_len < Self::ENCODED_LEN {
25208 payload_buf[0..avail_len].copy_from_slice(__input);
25209 Bytes::new(&payload_buf)
25210 } else {
25211 Bytes::new(__input)
25212 };
25213 let mut __struct = Self::default();
25214 __struct.param_count = buf.get_u16_le()?;
25215 __struct.param_index = buf.get_u16_le()?;
25216 let mut tmp = [0_u8; 16usize];
25217 for v in &mut tmp {
25218 *v = buf.get_u8()?;
25219 }
25220 __struct.param_id = CharArray::new(tmp);
25221 let mut tmp = [0_u8; 128usize];
25222 for v in &mut tmp {
25223 *v = buf.get_u8()?;
25224 }
25225 __struct.param_value = CharArray::new(tmp);
25226 let tmp = buf.get_u8()?;
25227 __struct.param_type =
25228 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25229 enum_type: "MavParamExtType",
25230 value: tmp as u64,
25231 })?;
25232 Ok(__struct)
25233 }
25234 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25235 let mut __tmp = BytesMut::new(bytes);
25236 #[allow(clippy::absurd_extreme_comparisons)]
25237 #[allow(unused_comparisons)]
25238 if __tmp.remaining() < Self::ENCODED_LEN {
25239 panic!(
25240 "buffer is too small (need {} bytes, but got {})",
25241 Self::ENCODED_LEN,
25242 __tmp.remaining(),
25243 )
25244 }
25245 __tmp.put_u16_le(self.param_count);
25246 __tmp.put_u16_le(self.param_index);
25247 for val in &self.param_id {
25248 __tmp.put_u8(*val);
25249 }
25250 for val in &self.param_value {
25251 __tmp.put_u8(*val);
25252 }
25253 __tmp.put_u8(self.param_type as u8);
25254 if matches!(version, MavlinkVersion::V2) {
25255 let len = __tmp.len();
25256 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25257 } else {
25258 __tmp.len()
25259 }
25260 }
25261}
25262#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
25263#[doc = ""]
25264#[doc = "ID: 50"]
25265#[derive(Debug, Clone, PartialEq)]
25266#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25267#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25268#[cfg_attr(feature = "ts", derive(TS))]
25269#[cfg_attr(feature = "ts", ts(export))]
25270pub struct PARAM_MAP_RC_DATA {
25271 #[doc = "Initial parameter value"]
25272 pub param_value0: f32,
25273 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
25274 pub scale: f32,
25275 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
25276 pub param_value_min: f32,
25277 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
25278 pub param_value_max: f32,
25279 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
25280 pub param_index: i16,
25281 #[doc = "System ID"]
25282 pub target_system: u8,
25283 #[doc = "Component ID"]
25284 pub target_component: u8,
25285 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
25286 #[cfg_attr(feature = "ts", ts(type = "string"))]
25287 pub param_id: CharArray<16>,
25288 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
25289 pub parameter_rc_channel_index: u8,
25290}
25291impl PARAM_MAP_RC_DATA {
25292 pub const ENCODED_LEN: usize = 37usize;
25293 pub const DEFAULT: Self = Self {
25294 param_value0: 0.0_f32,
25295 scale: 0.0_f32,
25296 param_value_min: 0.0_f32,
25297 param_value_max: 0.0_f32,
25298 param_index: 0_i16,
25299 target_system: 0_u8,
25300 target_component: 0_u8,
25301 param_id: CharArray::new([0_u8; 16usize]),
25302 parameter_rc_channel_index: 0_u8,
25303 };
25304 #[cfg(feature = "arbitrary")]
25305 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25306 use arbitrary::{Arbitrary, Unstructured};
25307 let mut buf = [0u8; 1024];
25308 rng.fill_bytes(&mut buf);
25309 let mut unstructured = Unstructured::new(&buf);
25310 Self::arbitrary(&mut unstructured).unwrap_or_default()
25311 }
25312}
25313impl Default for PARAM_MAP_RC_DATA {
25314 fn default() -> Self {
25315 Self::DEFAULT.clone()
25316 }
25317}
25318impl MessageData for PARAM_MAP_RC_DATA {
25319 type Message = MavMessage;
25320 const ID: u32 = 50u32;
25321 const NAME: &'static str = "PARAM_MAP_RC";
25322 const EXTRA_CRC: u8 = 78u8;
25323 const ENCODED_LEN: usize = 37usize;
25324 fn deser(
25325 _version: MavlinkVersion,
25326 __input: &[u8],
25327 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25328 let avail_len = __input.len();
25329 let mut payload_buf = [0; Self::ENCODED_LEN];
25330 let mut buf = if avail_len < Self::ENCODED_LEN {
25331 payload_buf[0..avail_len].copy_from_slice(__input);
25332 Bytes::new(&payload_buf)
25333 } else {
25334 Bytes::new(__input)
25335 };
25336 let mut __struct = Self::default();
25337 __struct.param_value0 = buf.get_f32_le()?;
25338 __struct.scale = buf.get_f32_le()?;
25339 __struct.param_value_min = buf.get_f32_le()?;
25340 __struct.param_value_max = buf.get_f32_le()?;
25341 __struct.param_index = buf.get_i16_le()?;
25342 __struct.target_system = buf.get_u8()?;
25343 __struct.target_component = buf.get_u8()?;
25344 let mut tmp = [0_u8; 16usize];
25345 for v in &mut tmp {
25346 *v = buf.get_u8()?;
25347 }
25348 __struct.param_id = CharArray::new(tmp);
25349 __struct.parameter_rc_channel_index = buf.get_u8()?;
25350 Ok(__struct)
25351 }
25352 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25353 let mut __tmp = BytesMut::new(bytes);
25354 #[allow(clippy::absurd_extreme_comparisons)]
25355 #[allow(unused_comparisons)]
25356 if __tmp.remaining() < Self::ENCODED_LEN {
25357 panic!(
25358 "buffer is too small (need {} bytes, but got {})",
25359 Self::ENCODED_LEN,
25360 __tmp.remaining(),
25361 )
25362 }
25363 __tmp.put_f32_le(self.param_value0);
25364 __tmp.put_f32_le(self.scale);
25365 __tmp.put_f32_le(self.param_value_min);
25366 __tmp.put_f32_le(self.param_value_max);
25367 __tmp.put_i16_le(self.param_index);
25368 __tmp.put_u8(self.target_system);
25369 __tmp.put_u8(self.target_component);
25370 for val in &self.param_id {
25371 __tmp.put_u8(*val);
25372 }
25373 __tmp.put_u8(self.parameter_rc_channel_index);
25374 if matches!(version, MavlinkVersion::V2) {
25375 let len = __tmp.len();
25376 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25377 } else {
25378 __tmp.len()
25379 }
25380 }
25381}
25382#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
25383#[doc = ""]
25384#[doc = "ID: 21"]
25385#[derive(Debug, Clone, PartialEq)]
25386#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25387#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25388#[cfg_attr(feature = "ts", derive(TS))]
25389#[cfg_attr(feature = "ts", ts(export))]
25390pub struct PARAM_REQUEST_LIST_DATA {
25391 #[doc = "System ID"]
25392 pub target_system: u8,
25393 #[doc = "Component ID"]
25394 pub target_component: u8,
25395}
25396impl PARAM_REQUEST_LIST_DATA {
25397 pub const ENCODED_LEN: usize = 2usize;
25398 pub const DEFAULT: Self = Self {
25399 target_system: 0_u8,
25400 target_component: 0_u8,
25401 };
25402 #[cfg(feature = "arbitrary")]
25403 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25404 use arbitrary::{Arbitrary, Unstructured};
25405 let mut buf = [0u8; 1024];
25406 rng.fill_bytes(&mut buf);
25407 let mut unstructured = Unstructured::new(&buf);
25408 Self::arbitrary(&mut unstructured).unwrap_or_default()
25409 }
25410}
25411impl Default for PARAM_REQUEST_LIST_DATA {
25412 fn default() -> Self {
25413 Self::DEFAULT.clone()
25414 }
25415}
25416impl MessageData for PARAM_REQUEST_LIST_DATA {
25417 type Message = MavMessage;
25418 const ID: u32 = 21u32;
25419 const NAME: &'static str = "PARAM_REQUEST_LIST";
25420 const EXTRA_CRC: u8 = 159u8;
25421 const ENCODED_LEN: usize = 2usize;
25422 fn deser(
25423 _version: MavlinkVersion,
25424 __input: &[u8],
25425 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25426 let avail_len = __input.len();
25427 let mut payload_buf = [0; Self::ENCODED_LEN];
25428 let mut buf = if avail_len < Self::ENCODED_LEN {
25429 payload_buf[0..avail_len].copy_from_slice(__input);
25430 Bytes::new(&payload_buf)
25431 } else {
25432 Bytes::new(__input)
25433 };
25434 let mut __struct = Self::default();
25435 __struct.target_system = buf.get_u8()?;
25436 __struct.target_component = buf.get_u8()?;
25437 Ok(__struct)
25438 }
25439 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25440 let mut __tmp = BytesMut::new(bytes);
25441 #[allow(clippy::absurd_extreme_comparisons)]
25442 #[allow(unused_comparisons)]
25443 if __tmp.remaining() < Self::ENCODED_LEN {
25444 panic!(
25445 "buffer is too small (need {} bytes, but got {})",
25446 Self::ENCODED_LEN,
25447 __tmp.remaining(),
25448 )
25449 }
25450 __tmp.put_u8(self.target_system);
25451 __tmp.put_u8(self.target_component);
25452 if matches!(version, MavlinkVersion::V2) {
25453 let len = __tmp.len();
25454 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25455 } else {
25456 __tmp.len()
25457 }
25458 }
25459}
25460#[doc = "Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] ->value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
25461#[doc = ""]
25462#[doc = "ID: 20"]
25463#[derive(Debug, Clone, PartialEq)]
25464#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25465#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25466#[cfg_attr(feature = "ts", derive(TS))]
25467#[cfg_attr(feature = "ts", ts(export))]
25468pub struct PARAM_REQUEST_READ_DATA {
25469 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
25470 pub param_index: i16,
25471 #[doc = "System ID"]
25472 pub target_system: u8,
25473 #[doc = "Component ID"]
25474 pub target_component: u8,
25475 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
25476 #[cfg_attr(feature = "ts", ts(type = "string"))]
25477 pub param_id: CharArray<16>,
25478}
25479impl PARAM_REQUEST_READ_DATA {
25480 pub const ENCODED_LEN: usize = 20usize;
25481 pub const DEFAULT: Self = Self {
25482 param_index: 0_i16,
25483 target_system: 0_u8,
25484 target_component: 0_u8,
25485 param_id: CharArray::new([0_u8; 16usize]),
25486 };
25487 #[cfg(feature = "arbitrary")]
25488 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25489 use arbitrary::{Arbitrary, Unstructured};
25490 let mut buf = [0u8; 1024];
25491 rng.fill_bytes(&mut buf);
25492 let mut unstructured = Unstructured::new(&buf);
25493 Self::arbitrary(&mut unstructured).unwrap_or_default()
25494 }
25495}
25496impl Default for PARAM_REQUEST_READ_DATA {
25497 fn default() -> Self {
25498 Self::DEFAULT.clone()
25499 }
25500}
25501impl MessageData for PARAM_REQUEST_READ_DATA {
25502 type Message = MavMessage;
25503 const ID: u32 = 20u32;
25504 const NAME: &'static str = "PARAM_REQUEST_READ";
25505 const EXTRA_CRC: u8 = 214u8;
25506 const ENCODED_LEN: usize = 20usize;
25507 fn deser(
25508 _version: MavlinkVersion,
25509 __input: &[u8],
25510 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25511 let avail_len = __input.len();
25512 let mut payload_buf = [0; Self::ENCODED_LEN];
25513 let mut buf = if avail_len < Self::ENCODED_LEN {
25514 payload_buf[0..avail_len].copy_from_slice(__input);
25515 Bytes::new(&payload_buf)
25516 } else {
25517 Bytes::new(__input)
25518 };
25519 let mut __struct = Self::default();
25520 __struct.param_index = buf.get_i16_le()?;
25521 __struct.target_system = buf.get_u8()?;
25522 __struct.target_component = buf.get_u8()?;
25523 let mut tmp = [0_u8; 16usize];
25524 for v in &mut tmp {
25525 *v = buf.get_u8()?;
25526 }
25527 __struct.param_id = CharArray::new(tmp);
25528 Ok(__struct)
25529 }
25530 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25531 let mut __tmp = BytesMut::new(bytes);
25532 #[allow(clippy::absurd_extreme_comparisons)]
25533 #[allow(unused_comparisons)]
25534 if __tmp.remaining() < Self::ENCODED_LEN {
25535 panic!(
25536 "buffer is too small (need {} bytes, but got {})",
25537 Self::ENCODED_LEN,
25538 __tmp.remaining(),
25539 )
25540 }
25541 __tmp.put_i16_le(self.param_index);
25542 __tmp.put_u8(self.target_system);
25543 __tmp.put_u8(self.target_component);
25544 for val in &self.param_id {
25545 __tmp.put_u8(*val);
25546 }
25547 if matches!(version, MavlinkVersion::V2) {
25548 let len = __tmp.len();
25549 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25550 } else {
25551 __tmp.len()
25552 }
25553 }
25554}
25555#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
25556#[doc = ""]
25557#[doc = "ID: 23"]
25558#[derive(Debug, Clone, PartialEq)]
25559#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25561#[cfg_attr(feature = "ts", derive(TS))]
25562#[cfg_attr(feature = "ts", ts(export))]
25563pub struct PARAM_SET_DATA {
25564 #[doc = "Onboard parameter value"]
25565 pub param_value: f32,
25566 #[doc = "System ID"]
25567 pub target_system: u8,
25568 #[doc = "Component ID"]
25569 pub target_component: u8,
25570 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
25571 #[cfg_attr(feature = "ts", ts(type = "string"))]
25572 pub param_id: CharArray<16>,
25573 #[doc = "Onboard parameter type."]
25574 pub param_type: MavParamType,
25575}
25576impl PARAM_SET_DATA {
25577 pub const ENCODED_LEN: usize = 23usize;
25578 pub const DEFAULT: Self = Self {
25579 param_value: 0.0_f32,
25580 target_system: 0_u8,
25581 target_component: 0_u8,
25582 param_id: CharArray::new([0_u8; 16usize]),
25583 param_type: MavParamType::DEFAULT,
25584 };
25585 #[cfg(feature = "arbitrary")]
25586 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25587 use arbitrary::{Arbitrary, Unstructured};
25588 let mut buf = [0u8; 1024];
25589 rng.fill_bytes(&mut buf);
25590 let mut unstructured = Unstructured::new(&buf);
25591 Self::arbitrary(&mut unstructured).unwrap_or_default()
25592 }
25593}
25594impl Default for PARAM_SET_DATA {
25595 fn default() -> Self {
25596 Self::DEFAULT.clone()
25597 }
25598}
25599impl MessageData for PARAM_SET_DATA {
25600 type Message = MavMessage;
25601 const ID: u32 = 23u32;
25602 const NAME: &'static str = "PARAM_SET";
25603 const EXTRA_CRC: u8 = 168u8;
25604 const ENCODED_LEN: usize = 23usize;
25605 fn deser(
25606 _version: MavlinkVersion,
25607 __input: &[u8],
25608 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25609 let avail_len = __input.len();
25610 let mut payload_buf = [0; Self::ENCODED_LEN];
25611 let mut buf = if avail_len < Self::ENCODED_LEN {
25612 payload_buf[0..avail_len].copy_from_slice(__input);
25613 Bytes::new(&payload_buf)
25614 } else {
25615 Bytes::new(__input)
25616 };
25617 let mut __struct = Self::default();
25618 __struct.param_value = buf.get_f32_le()?;
25619 __struct.target_system = buf.get_u8()?;
25620 __struct.target_component = buf.get_u8()?;
25621 let mut tmp = [0_u8; 16usize];
25622 for v in &mut tmp {
25623 *v = buf.get_u8()?;
25624 }
25625 __struct.param_id = CharArray::new(tmp);
25626 let tmp = buf.get_u8()?;
25627 __struct.param_type =
25628 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25629 enum_type: "MavParamType",
25630 value: tmp as u64,
25631 })?;
25632 Ok(__struct)
25633 }
25634 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25635 let mut __tmp = BytesMut::new(bytes);
25636 #[allow(clippy::absurd_extreme_comparisons)]
25637 #[allow(unused_comparisons)]
25638 if __tmp.remaining() < Self::ENCODED_LEN {
25639 panic!(
25640 "buffer is too small (need {} bytes, but got {})",
25641 Self::ENCODED_LEN,
25642 __tmp.remaining(),
25643 )
25644 }
25645 __tmp.put_f32_le(self.param_value);
25646 __tmp.put_u8(self.target_system);
25647 __tmp.put_u8(self.target_component);
25648 for val in &self.param_id {
25649 __tmp.put_u8(*val);
25650 }
25651 __tmp.put_u8(self.param_type as u8);
25652 if matches!(version, MavlinkVersion::V2) {
25653 let len = __tmp.len();
25654 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25655 } else {
25656 __tmp.len()
25657 }
25658 }
25659}
25660#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
25661#[doc = ""]
25662#[doc = "ID: 22"]
25663#[derive(Debug, Clone, PartialEq)]
25664#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25665#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25666#[cfg_attr(feature = "ts", derive(TS))]
25667#[cfg_attr(feature = "ts", ts(export))]
25668pub struct PARAM_VALUE_DATA {
25669 #[doc = "Onboard parameter value"]
25670 pub param_value: f32,
25671 #[doc = "Total number of onboard parameters"]
25672 pub param_count: u16,
25673 #[doc = "Index of this onboard parameter"]
25674 pub param_index: u16,
25675 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
25676 #[cfg_attr(feature = "ts", ts(type = "string"))]
25677 pub param_id: CharArray<16>,
25678 #[doc = "Onboard parameter type."]
25679 pub param_type: MavParamType,
25680}
25681impl PARAM_VALUE_DATA {
25682 pub const ENCODED_LEN: usize = 25usize;
25683 pub const DEFAULT: Self = Self {
25684 param_value: 0.0_f32,
25685 param_count: 0_u16,
25686 param_index: 0_u16,
25687 param_id: CharArray::new([0_u8; 16usize]),
25688 param_type: MavParamType::DEFAULT,
25689 };
25690 #[cfg(feature = "arbitrary")]
25691 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25692 use arbitrary::{Arbitrary, Unstructured};
25693 let mut buf = [0u8; 1024];
25694 rng.fill_bytes(&mut buf);
25695 let mut unstructured = Unstructured::new(&buf);
25696 Self::arbitrary(&mut unstructured).unwrap_or_default()
25697 }
25698}
25699impl Default for PARAM_VALUE_DATA {
25700 fn default() -> Self {
25701 Self::DEFAULT.clone()
25702 }
25703}
25704impl MessageData for PARAM_VALUE_DATA {
25705 type Message = MavMessage;
25706 const ID: u32 = 22u32;
25707 const NAME: &'static str = "PARAM_VALUE";
25708 const EXTRA_CRC: u8 = 220u8;
25709 const ENCODED_LEN: usize = 25usize;
25710 fn deser(
25711 _version: MavlinkVersion,
25712 __input: &[u8],
25713 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25714 let avail_len = __input.len();
25715 let mut payload_buf = [0; Self::ENCODED_LEN];
25716 let mut buf = if avail_len < Self::ENCODED_LEN {
25717 payload_buf[0..avail_len].copy_from_slice(__input);
25718 Bytes::new(&payload_buf)
25719 } else {
25720 Bytes::new(__input)
25721 };
25722 let mut __struct = Self::default();
25723 __struct.param_value = buf.get_f32_le()?;
25724 __struct.param_count = buf.get_u16_le()?;
25725 __struct.param_index = buf.get_u16_le()?;
25726 let mut tmp = [0_u8; 16usize];
25727 for v in &mut tmp {
25728 *v = buf.get_u8()?;
25729 }
25730 __struct.param_id = CharArray::new(tmp);
25731 let tmp = buf.get_u8()?;
25732 __struct.param_type =
25733 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25734 enum_type: "MavParamType",
25735 value: tmp as u64,
25736 })?;
25737 Ok(__struct)
25738 }
25739 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25740 let mut __tmp = BytesMut::new(bytes);
25741 #[allow(clippy::absurd_extreme_comparisons)]
25742 #[allow(unused_comparisons)]
25743 if __tmp.remaining() < Self::ENCODED_LEN {
25744 panic!(
25745 "buffer is too small (need {} bytes, but got {})",
25746 Self::ENCODED_LEN,
25747 __tmp.remaining(),
25748 )
25749 }
25750 __tmp.put_f32_le(self.param_value);
25751 __tmp.put_u16_le(self.param_count);
25752 __tmp.put_u16_le(self.param_index);
25753 for val in &self.param_id {
25754 __tmp.put_u8(*val);
25755 }
25756 __tmp.put_u8(self.param_type as u8);
25757 if matches!(version, MavlinkVersion::V2) {
25758 let len = __tmp.len();
25759 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25760 } else {
25761 __tmp.len()
25762 }
25763 }
25764}
25765#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
25766#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
25767#[doc = ""]
25768#[doc = "ID: 4"]
25769#[derive(Debug, Clone, PartialEq)]
25770#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25771#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25772#[cfg_attr(feature = "ts", derive(TS))]
25773#[cfg_attr(feature = "ts", ts(export))]
25774pub struct PING_DATA {
25775 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25776 pub time_usec: u64,
25777 #[doc = "PING sequence"]
25778 pub seq: u32,
25779 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
25780 pub target_system: u8,
25781 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
25782 pub target_component: u8,
25783}
25784impl PING_DATA {
25785 pub const ENCODED_LEN: usize = 14usize;
25786 pub const DEFAULT: Self = Self {
25787 time_usec: 0_u64,
25788 seq: 0_u32,
25789 target_system: 0_u8,
25790 target_component: 0_u8,
25791 };
25792 #[cfg(feature = "arbitrary")]
25793 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25794 use arbitrary::{Arbitrary, Unstructured};
25795 let mut buf = [0u8; 1024];
25796 rng.fill_bytes(&mut buf);
25797 let mut unstructured = Unstructured::new(&buf);
25798 Self::arbitrary(&mut unstructured).unwrap_or_default()
25799 }
25800}
25801impl Default for PING_DATA {
25802 fn default() -> Self {
25803 Self::DEFAULT.clone()
25804 }
25805}
25806impl MessageData for PING_DATA {
25807 type Message = MavMessage;
25808 const ID: u32 = 4u32;
25809 const NAME: &'static str = "PING";
25810 const EXTRA_CRC: u8 = 237u8;
25811 const ENCODED_LEN: usize = 14usize;
25812 fn deser(
25813 _version: MavlinkVersion,
25814 __input: &[u8],
25815 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25816 let avail_len = __input.len();
25817 let mut payload_buf = [0; Self::ENCODED_LEN];
25818 let mut buf = if avail_len < Self::ENCODED_LEN {
25819 payload_buf[0..avail_len].copy_from_slice(__input);
25820 Bytes::new(&payload_buf)
25821 } else {
25822 Bytes::new(__input)
25823 };
25824 let mut __struct = Self::default();
25825 __struct.time_usec = buf.get_u64_le()?;
25826 __struct.seq = buf.get_u32_le()?;
25827 __struct.target_system = buf.get_u8()?;
25828 __struct.target_component = buf.get_u8()?;
25829 Ok(__struct)
25830 }
25831 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25832 let mut __tmp = BytesMut::new(bytes);
25833 #[allow(clippy::absurd_extreme_comparisons)]
25834 #[allow(unused_comparisons)]
25835 if __tmp.remaining() < Self::ENCODED_LEN {
25836 panic!(
25837 "buffer is too small (need {} bytes, but got {})",
25838 Self::ENCODED_LEN,
25839 __tmp.remaining(),
25840 )
25841 }
25842 __tmp.put_u64_le(self.time_usec);
25843 __tmp.put_u32_le(self.seq);
25844 __tmp.put_u8(self.target_system);
25845 __tmp.put_u8(self.target_component);
25846 if matches!(version, MavlinkVersion::V2) {
25847 let len = __tmp.len();
25848 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25849 } else {
25850 __tmp.len()
25851 }
25852 }
25853}
25854#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
25855#[doc = "Control vehicle tone generation (buzzer)."]
25856#[doc = ""]
25857#[doc = "ID: 258"]
25858#[derive(Debug, Clone, PartialEq)]
25859#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25860#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25861#[cfg_attr(feature = "ts", derive(TS))]
25862#[cfg_attr(feature = "ts", ts(export))]
25863pub struct PLAY_TUNE_DATA {
25864 #[doc = "System ID"]
25865 pub target_system: u8,
25866 #[doc = "Component ID"]
25867 pub target_component: u8,
25868 #[doc = "tune in board specific format"]
25869 #[cfg_attr(feature = "ts", ts(type = "string"))]
25870 pub tune: CharArray<30>,
25871 #[doc = "tune extension (appended to tune)"]
25872 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25873 #[cfg_attr(feature = "ts", ts(type = "string"))]
25874 pub tune2: CharArray<200>,
25875}
25876impl PLAY_TUNE_DATA {
25877 pub const ENCODED_LEN: usize = 232usize;
25878 pub const DEFAULT: Self = Self {
25879 target_system: 0_u8,
25880 target_component: 0_u8,
25881 tune: CharArray::new([0_u8; 30usize]),
25882 tune2: CharArray::new([0_u8; 200usize]),
25883 };
25884 #[cfg(feature = "arbitrary")]
25885 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25886 use arbitrary::{Arbitrary, Unstructured};
25887 let mut buf = [0u8; 1024];
25888 rng.fill_bytes(&mut buf);
25889 let mut unstructured = Unstructured::new(&buf);
25890 Self::arbitrary(&mut unstructured).unwrap_or_default()
25891 }
25892}
25893impl Default for PLAY_TUNE_DATA {
25894 fn default() -> Self {
25895 Self::DEFAULT.clone()
25896 }
25897}
25898impl MessageData for PLAY_TUNE_DATA {
25899 type Message = MavMessage;
25900 const ID: u32 = 258u32;
25901 const NAME: &'static str = "PLAY_TUNE";
25902 const EXTRA_CRC: u8 = 187u8;
25903 const ENCODED_LEN: usize = 232usize;
25904 fn deser(
25905 _version: MavlinkVersion,
25906 __input: &[u8],
25907 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25908 let avail_len = __input.len();
25909 let mut payload_buf = [0; Self::ENCODED_LEN];
25910 let mut buf = if avail_len < Self::ENCODED_LEN {
25911 payload_buf[0..avail_len].copy_from_slice(__input);
25912 Bytes::new(&payload_buf)
25913 } else {
25914 Bytes::new(__input)
25915 };
25916 let mut __struct = Self::default();
25917 __struct.target_system = buf.get_u8()?;
25918 __struct.target_component = buf.get_u8()?;
25919 let mut tmp = [0_u8; 30usize];
25920 for v in &mut tmp {
25921 *v = buf.get_u8()?;
25922 }
25923 __struct.tune = CharArray::new(tmp);
25924 let mut tmp = [0_u8; 200usize];
25925 for v in &mut tmp {
25926 *v = buf.get_u8()?;
25927 }
25928 __struct.tune2 = CharArray::new(tmp);
25929 Ok(__struct)
25930 }
25931 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25932 let mut __tmp = BytesMut::new(bytes);
25933 #[allow(clippy::absurd_extreme_comparisons)]
25934 #[allow(unused_comparisons)]
25935 if __tmp.remaining() < Self::ENCODED_LEN {
25936 panic!(
25937 "buffer is too small (need {} bytes, but got {})",
25938 Self::ENCODED_LEN,
25939 __tmp.remaining(),
25940 )
25941 }
25942 __tmp.put_u8(self.target_system);
25943 __tmp.put_u8(self.target_component);
25944 for val in &self.tune {
25945 __tmp.put_u8(*val);
25946 }
25947 if matches!(version, MavlinkVersion::V2) {
25948 for val in &self.tune2 {
25949 __tmp.put_u8(*val);
25950 }
25951 let len = __tmp.len();
25952 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25953 } else {
25954 __tmp.len()
25955 }
25956 }
25957}
25958#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
25959#[doc = ""]
25960#[doc = "ID: 400"]
25961#[derive(Debug, Clone, PartialEq)]
25962#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25963#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25964#[cfg_attr(feature = "ts", derive(TS))]
25965#[cfg_attr(feature = "ts", ts(export))]
25966pub struct PLAY_TUNE_V2_DATA {
25967 #[doc = "Tune format"]
25968 pub format: TuneFormat,
25969 #[doc = "System ID"]
25970 pub target_system: u8,
25971 #[doc = "Component ID"]
25972 pub target_component: u8,
25973 #[doc = "Tune definition as a NULL-terminated string."]
25974 #[cfg_attr(feature = "ts", ts(type = "string"))]
25975 pub tune: CharArray<248>,
25976}
25977impl PLAY_TUNE_V2_DATA {
25978 pub const ENCODED_LEN: usize = 254usize;
25979 pub const DEFAULT: Self = Self {
25980 format: TuneFormat::DEFAULT,
25981 target_system: 0_u8,
25982 target_component: 0_u8,
25983 tune: CharArray::new([0_u8; 248usize]),
25984 };
25985 #[cfg(feature = "arbitrary")]
25986 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25987 use arbitrary::{Arbitrary, Unstructured};
25988 let mut buf = [0u8; 1024];
25989 rng.fill_bytes(&mut buf);
25990 let mut unstructured = Unstructured::new(&buf);
25991 Self::arbitrary(&mut unstructured).unwrap_or_default()
25992 }
25993}
25994impl Default for PLAY_TUNE_V2_DATA {
25995 fn default() -> Self {
25996 Self::DEFAULT.clone()
25997 }
25998}
25999impl MessageData for PLAY_TUNE_V2_DATA {
26000 type Message = MavMessage;
26001 const ID: u32 = 400u32;
26002 const NAME: &'static str = "PLAY_TUNE_V2";
26003 const EXTRA_CRC: u8 = 110u8;
26004 const ENCODED_LEN: usize = 254usize;
26005 fn deser(
26006 _version: MavlinkVersion,
26007 __input: &[u8],
26008 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26009 let avail_len = __input.len();
26010 let mut payload_buf = [0; Self::ENCODED_LEN];
26011 let mut buf = if avail_len < Self::ENCODED_LEN {
26012 payload_buf[0..avail_len].copy_from_slice(__input);
26013 Bytes::new(&payload_buf)
26014 } else {
26015 Bytes::new(__input)
26016 };
26017 let mut __struct = Self::default();
26018 let tmp = buf.get_u32_le()?;
26019 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
26020 ::mavlink_core::error::ParserError::InvalidEnum {
26021 enum_type: "TuneFormat",
26022 value: tmp as u64,
26023 },
26024 )?;
26025 __struct.target_system = buf.get_u8()?;
26026 __struct.target_component = buf.get_u8()?;
26027 let mut tmp = [0_u8; 248usize];
26028 for v in &mut tmp {
26029 *v = buf.get_u8()?;
26030 }
26031 __struct.tune = CharArray::new(tmp);
26032 Ok(__struct)
26033 }
26034 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26035 let mut __tmp = BytesMut::new(bytes);
26036 #[allow(clippy::absurd_extreme_comparisons)]
26037 #[allow(unused_comparisons)]
26038 if __tmp.remaining() < Self::ENCODED_LEN {
26039 panic!(
26040 "buffer is too small (need {} bytes, but got {})",
26041 Self::ENCODED_LEN,
26042 __tmp.remaining(),
26043 )
26044 }
26045 __tmp.put_u32_le(self.format as u32);
26046 __tmp.put_u8(self.target_system);
26047 __tmp.put_u8(self.target_component);
26048 for val in &self.tune {
26049 __tmp.put_u8(*val);
26050 }
26051 if matches!(version, MavlinkVersion::V2) {
26052 let len = __tmp.len();
26053 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26054 } else {
26055 __tmp.len()
26056 }
26057 }
26058}
26059#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
26060#[doc = ""]
26061#[doc = "ID: 87"]
26062#[derive(Debug, Clone, PartialEq)]
26063#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26064#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26065#[cfg_attr(feature = "ts", derive(TS))]
26066#[cfg_attr(feature = "ts", ts(export))]
26067pub struct POSITION_TARGET_GLOBAL_INT_DATA {
26068 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
26069 pub time_boot_ms: u32,
26070 #[doc = "Latitude in WGS84 frame"]
26071 pub lat_int: i32,
26072 #[doc = "Longitude in WGS84 frame"]
26073 pub lon_int: i32,
26074 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
26075 pub alt: f32,
26076 #[doc = "X velocity in NED frame"]
26077 pub vx: f32,
26078 #[doc = "Y velocity in NED frame"]
26079 pub vy: f32,
26080 #[doc = "Z velocity in NED frame"]
26081 pub vz: f32,
26082 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
26083 pub afx: f32,
26084 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
26085 pub afy: f32,
26086 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
26087 pub afz: f32,
26088 #[doc = "yaw setpoint"]
26089 pub yaw: f32,
26090 #[doc = "yaw rate setpoint"]
26091 pub yaw_rate: f32,
26092 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
26093 pub type_mask: PositionTargetTypemask,
26094 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
26095 pub coordinate_frame: MavFrame,
26096}
26097impl POSITION_TARGET_GLOBAL_INT_DATA {
26098 pub const ENCODED_LEN: usize = 51usize;
26099 pub const DEFAULT: Self = Self {
26100 time_boot_ms: 0_u32,
26101 lat_int: 0_i32,
26102 lon_int: 0_i32,
26103 alt: 0.0_f32,
26104 vx: 0.0_f32,
26105 vy: 0.0_f32,
26106 vz: 0.0_f32,
26107 afx: 0.0_f32,
26108 afy: 0.0_f32,
26109 afz: 0.0_f32,
26110 yaw: 0.0_f32,
26111 yaw_rate: 0.0_f32,
26112 type_mask: PositionTargetTypemask::DEFAULT,
26113 coordinate_frame: MavFrame::DEFAULT,
26114 };
26115 #[cfg(feature = "arbitrary")]
26116 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26117 use arbitrary::{Arbitrary, Unstructured};
26118 let mut buf = [0u8; 1024];
26119 rng.fill_bytes(&mut buf);
26120 let mut unstructured = Unstructured::new(&buf);
26121 Self::arbitrary(&mut unstructured).unwrap_or_default()
26122 }
26123}
26124impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
26125 fn default() -> Self {
26126 Self::DEFAULT.clone()
26127 }
26128}
26129impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
26130 type Message = MavMessage;
26131 const ID: u32 = 87u32;
26132 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
26133 const EXTRA_CRC: u8 = 150u8;
26134 const ENCODED_LEN: usize = 51usize;
26135 fn deser(
26136 _version: MavlinkVersion,
26137 __input: &[u8],
26138 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26139 let avail_len = __input.len();
26140 let mut payload_buf = [0; Self::ENCODED_LEN];
26141 let mut buf = if avail_len < Self::ENCODED_LEN {
26142 payload_buf[0..avail_len].copy_from_slice(__input);
26143 Bytes::new(&payload_buf)
26144 } else {
26145 Bytes::new(__input)
26146 };
26147 let mut __struct = Self::default();
26148 __struct.time_boot_ms = buf.get_u32_le()?;
26149 __struct.lat_int = buf.get_i32_le()?;
26150 __struct.lon_int = buf.get_i32_le()?;
26151 __struct.alt = buf.get_f32_le()?;
26152 __struct.vx = buf.get_f32_le()?;
26153 __struct.vy = buf.get_f32_le()?;
26154 __struct.vz = buf.get_f32_le()?;
26155 __struct.afx = buf.get_f32_le()?;
26156 __struct.afy = buf.get_f32_le()?;
26157 __struct.afz = buf.get_f32_le()?;
26158 __struct.yaw = buf.get_f32_le()?;
26159 __struct.yaw_rate = buf.get_f32_le()?;
26160 let tmp = buf.get_u16_le()?;
26161 __struct.type_mask =
26162 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
26163 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
26164 flag_type: "PositionTargetTypemask",
26165 value: tmp as u64,
26166 })?;
26167 let tmp = buf.get_u8()?;
26168 __struct.coordinate_frame =
26169 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26170 enum_type: "MavFrame",
26171 value: tmp as u64,
26172 })?;
26173 Ok(__struct)
26174 }
26175 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26176 let mut __tmp = BytesMut::new(bytes);
26177 #[allow(clippy::absurd_extreme_comparisons)]
26178 #[allow(unused_comparisons)]
26179 if __tmp.remaining() < Self::ENCODED_LEN {
26180 panic!(
26181 "buffer is too small (need {} bytes, but got {})",
26182 Self::ENCODED_LEN,
26183 __tmp.remaining(),
26184 )
26185 }
26186 __tmp.put_u32_le(self.time_boot_ms);
26187 __tmp.put_i32_le(self.lat_int);
26188 __tmp.put_i32_le(self.lon_int);
26189 __tmp.put_f32_le(self.alt);
26190 __tmp.put_f32_le(self.vx);
26191 __tmp.put_f32_le(self.vy);
26192 __tmp.put_f32_le(self.vz);
26193 __tmp.put_f32_le(self.afx);
26194 __tmp.put_f32_le(self.afy);
26195 __tmp.put_f32_le(self.afz);
26196 __tmp.put_f32_le(self.yaw);
26197 __tmp.put_f32_le(self.yaw_rate);
26198 __tmp.put_u16_le(self.type_mask.bits() as u16);
26199 __tmp.put_u8(self.coordinate_frame as u8);
26200 if matches!(version, MavlinkVersion::V2) {
26201 let len = __tmp.len();
26202 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26203 } else {
26204 __tmp.len()
26205 }
26206 }
26207}
26208#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
26209#[doc = ""]
26210#[doc = "ID: 85"]
26211#[derive(Debug, Clone, PartialEq)]
26212#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26213#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26214#[cfg_attr(feature = "ts", derive(TS))]
26215#[cfg_attr(feature = "ts", ts(export))]
26216pub struct POSITION_TARGET_LOCAL_NED_DATA {
26217 #[doc = "Timestamp (time since system boot)."]
26218 pub time_boot_ms: u32,
26219 #[doc = "X Position in NED frame"]
26220 pub x: f32,
26221 #[doc = "Y Position in NED frame"]
26222 pub y: f32,
26223 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
26224 pub z: f32,
26225 #[doc = "X velocity in NED frame"]
26226 pub vx: f32,
26227 #[doc = "Y velocity in NED frame"]
26228 pub vy: f32,
26229 #[doc = "Z velocity in NED frame"]
26230 pub vz: f32,
26231 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
26232 pub afx: f32,
26233 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
26234 pub afy: f32,
26235 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
26236 pub afz: f32,
26237 #[doc = "yaw setpoint"]
26238 pub yaw: f32,
26239 #[doc = "yaw rate setpoint"]
26240 pub yaw_rate: f32,
26241 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
26242 pub type_mask: PositionTargetTypemask,
26243 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
26244 pub coordinate_frame: MavFrame,
26245}
26246impl POSITION_TARGET_LOCAL_NED_DATA {
26247 pub const ENCODED_LEN: usize = 51usize;
26248 pub const DEFAULT: Self = Self {
26249 time_boot_ms: 0_u32,
26250 x: 0.0_f32,
26251 y: 0.0_f32,
26252 z: 0.0_f32,
26253 vx: 0.0_f32,
26254 vy: 0.0_f32,
26255 vz: 0.0_f32,
26256 afx: 0.0_f32,
26257 afy: 0.0_f32,
26258 afz: 0.0_f32,
26259 yaw: 0.0_f32,
26260 yaw_rate: 0.0_f32,
26261 type_mask: PositionTargetTypemask::DEFAULT,
26262 coordinate_frame: MavFrame::DEFAULT,
26263 };
26264 #[cfg(feature = "arbitrary")]
26265 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26266 use arbitrary::{Arbitrary, Unstructured};
26267 let mut buf = [0u8; 1024];
26268 rng.fill_bytes(&mut buf);
26269 let mut unstructured = Unstructured::new(&buf);
26270 Self::arbitrary(&mut unstructured).unwrap_or_default()
26271 }
26272}
26273impl Default for POSITION_TARGET_LOCAL_NED_DATA {
26274 fn default() -> Self {
26275 Self::DEFAULT.clone()
26276 }
26277}
26278impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
26279 type Message = MavMessage;
26280 const ID: u32 = 85u32;
26281 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
26282 const EXTRA_CRC: u8 = 140u8;
26283 const ENCODED_LEN: usize = 51usize;
26284 fn deser(
26285 _version: MavlinkVersion,
26286 __input: &[u8],
26287 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26288 let avail_len = __input.len();
26289 let mut payload_buf = [0; Self::ENCODED_LEN];
26290 let mut buf = if avail_len < Self::ENCODED_LEN {
26291 payload_buf[0..avail_len].copy_from_slice(__input);
26292 Bytes::new(&payload_buf)
26293 } else {
26294 Bytes::new(__input)
26295 };
26296 let mut __struct = Self::default();
26297 __struct.time_boot_ms = buf.get_u32_le()?;
26298 __struct.x = buf.get_f32_le()?;
26299 __struct.y = buf.get_f32_le()?;
26300 __struct.z = buf.get_f32_le()?;
26301 __struct.vx = buf.get_f32_le()?;
26302 __struct.vy = buf.get_f32_le()?;
26303 __struct.vz = buf.get_f32_le()?;
26304 __struct.afx = buf.get_f32_le()?;
26305 __struct.afy = buf.get_f32_le()?;
26306 __struct.afz = buf.get_f32_le()?;
26307 __struct.yaw = buf.get_f32_le()?;
26308 __struct.yaw_rate = buf.get_f32_le()?;
26309 let tmp = buf.get_u16_le()?;
26310 __struct.type_mask =
26311 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
26312 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
26313 flag_type: "PositionTargetTypemask",
26314 value: tmp as u64,
26315 })?;
26316 let tmp = buf.get_u8()?;
26317 __struct.coordinate_frame =
26318 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26319 enum_type: "MavFrame",
26320 value: tmp as u64,
26321 })?;
26322 Ok(__struct)
26323 }
26324 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26325 let mut __tmp = BytesMut::new(bytes);
26326 #[allow(clippy::absurd_extreme_comparisons)]
26327 #[allow(unused_comparisons)]
26328 if __tmp.remaining() < Self::ENCODED_LEN {
26329 panic!(
26330 "buffer is too small (need {} bytes, but got {})",
26331 Self::ENCODED_LEN,
26332 __tmp.remaining(),
26333 )
26334 }
26335 __tmp.put_u32_le(self.time_boot_ms);
26336 __tmp.put_f32_le(self.x);
26337 __tmp.put_f32_le(self.y);
26338 __tmp.put_f32_le(self.z);
26339 __tmp.put_f32_le(self.vx);
26340 __tmp.put_f32_le(self.vy);
26341 __tmp.put_f32_le(self.vz);
26342 __tmp.put_f32_le(self.afx);
26343 __tmp.put_f32_le(self.afy);
26344 __tmp.put_f32_le(self.afz);
26345 __tmp.put_f32_le(self.yaw);
26346 __tmp.put_f32_le(self.yaw_rate);
26347 __tmp.put_u16_le(self.type_mask.bits() as u16);
26348 __tmp.put_u8(self.coordinate_frame as u8);
26349 if matches!(version, MavlinkVersion::V2) {
26350 let len = __tmp.len();
26351 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26352 } else {
26353 __tmp.len()
26354 }
26355 }
26356}
26357#[doc = "Power supply status."]
26358#[doc = ""]
26359#[doc = "ID: 125"]
26360#[derive(Debug, Clone, PartialEq)]
26361#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26362#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26363#[cfg_attr(feature = "ts", derive(TS))]
26364#[cfg_attr(feature = "ts", ts(export))]
26365pub struct POWER_STATUS_DATA {
26366 #[doc = "5V rail voltage."]
26367 pub Vcc: u16,
26368 #[doc = "Servo rail voltage."]
26369 pub Vservo: u16,
26370 #[doc = "Bitmap of power supply status flags."]
26371 pub flags: MavPowerStatus,
26372}
26373impl POWER_STATUS_DATA {
26374 pub const ENCODED_LEN: usize = 6usize;
26375 pub const DEFAULT: Self = Self {
26376 Vcc: 0_u16,
26377 Vservo: 0_u16,
26378 flags: MavPowerStatus::DEFAULT,
26379 };
26380 #[cfg(feature = "arbitrary")]
26381 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26382 use arbitrary::{Arbitrary, Unstructured};
26383 let mut buf = [0u8; 1024];
26384 rng.fill_bytes(&mut buf);
26385 let mut unstructured = Unstructured::new(&buf);
26386 Self::arbitrary(&mut unstructured).unwrap_or_default()
26387 }
26388}
26389impl Default for POWER_STATUS_DATA {
26390 fn default() -> Self {
26391 Self::DEFAULT.clone()
26392 }
26393}
26394impl MessageData for POWER_STATUS_DATA {
26395 type Message = MavMessage;
26396 const ID: u32 = 125u32;
26397 const NAME: &'static str = "POWER_STATUS";
26398 const EXTRA_CRC: u8 = 203u8;
26399 const ENCODED_LEN: usize = 6usize;
26400 fn deser(
26401 _version: MavlinkVersion,
26402 __input: &[u8],
26403 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26404 let avail_len = __input.len();
26405 let mut payload_buf = [0; Self::ENCODED_LEN];
26406 let mut buf = if avail_len < Self::ENCODED_LEN {
26407 payload_buf[0..avail_len].copy_from_slice(__input);
26408 Bytes::new(&payload_buf)
26409 } else {
26410 Bytes::new(__input)
26411 };
26412 let mut __struct = Self::default();
26413 __struct.Vcc = buf.get_u16_le()?;
26414 __struct.Vservo = buf.get_u16_le()?;
26415 let tmp = buf.get_u16_le()?;
26416 __struct.flags = MavPowerStatus::from_bits(tmp as <MavPowerStatus as Flags>::Bits).ok_or(
26417 ::mavlink_core::error::ParserError::InvalidFlag {
26418 flag_type: "MavPowerStatus",
26419 value: tmp as u64,
26420 },
26421 )?;
26422 Ok(__struct)
26423 }
26424 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26425 let mut __tmp = BytesMut::new(bytes);
26426 #[allow(clippy::absurd_extreme_comparisons)]
26427 #[allow(unused_comparisons)]
26428 if __tmp.remaining() < Self::ENCODED_LEN {
26429 panic!(
26430 "buffer is too small (need {} bytes, but got {})",
26431 Self::ENCODED_LEN,
26432 __tmp.remaining(),
26433 )
26434 }
26435 __tmp.put_u16_le(self.Vcc);
26436 __tmp.put_u16_le(self.Vservo);
26437 __tmp.put_u16_le(self.flags.bits() as u16);
26438 if matches!(version, MavlinkVersion::V2) {
26439 let len = __tmp.len();
26440 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26441 } else {
26442 __tmp.len()
26443 }
26444 }
26445}
26446#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
26447#[doc = ""]
26448#[doc = "ID: 300"]
26449#[derive(Debug, Clone, PartialEq)]
26450#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26452#[cfg_attr(feature = "ts", derive(TS))]
26453#[cfg_attr(feature = "ts", ts(export))]
26454pub struct PROTOCOL_VERSION_DATA {
26455 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
26456 pub version: u16,
26457 #[doc = "Minimum MAVLink version supported"]
26458 pub min_version: u16,
26459 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
26460 pub max_version: u16,
26461 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
26462 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26463 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26464 pub spec_version_hash: [u8; 8],
26465 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
26466 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26467 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26468 pub library_version_hash: [u8; 8],
26469}
26470impl PROTOCOL_VERSION_DATA {
26471 pub const ENCODED_LEN: usize = 22usize;
26472 pub const DEFAULT: Self = Self {
26473 version: 0_u16,
26474 min_version: 0_u16,
26475 max_version: 0_u16,
26476 spec_version_hash: [0_u8; 8usize],
26477 library_version_hash: [0_u8; 8usize],
26478 };
26479 #[cfg(feature = "arbitrary")]
26480 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26481 use arbitrary::{Arbitrary, Unstructured};
26482 let mut buf = [0u8; 1024];
26483 rng.fill_bytes(&mut buf);
26484 let mut unstructured = Unstructured::new(&buf);
26485 Self::arbitrary(&mut unstructured).unwrap_or_default()
26486 }
26487}
26488impl Default for PROTOCOL_VERSION_DATA {
26489 fn default() -> Self {
26490 Self::DEFAULT.clone()
26491 }
26492}
26493impl MessageData for PROTOCOL_VERSION_DATA {
26494 type Message = MavMessage;
26495 const ID: u32 = 300u32;
26496 const NAME: &'static str = "PROTOCOL_VERSION";
26497 const EXTRA_CRC: u8 = 217u8;
26498 const ENCODED_LEN: usize = 22usize;
26499 fn deser(
26500 _version: MavlinkVersion,
26501 __input: &[u8],
26502 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26503 let avail_len = __input.len();
26504 let mut payload_buf = [0; Self::ENCODED_LEN];
26505 let mut buf = if avail_len < Self::ENCODED_LEN {
26506 payload_buf[0..avail_len].copy_from_slice(__input);
26507 Bytes::new(&payload_buf)
26508 } else {
26509 Bytes::new(__input)
26510 };
26511 let mut __struct = Self::default();
26512 __struct.version = buf.get_u16_le()?;
26513 __struct.min_version = buf.get_u16_le()?;
26514 __struct.max_version = buf.get_u16_le()?;
26515 for v in &mut __struct.spec_version_hash {
26516 let val = buf.get_u8()?;
26517 *v = val;
26518 }
26519 for v in &mut __struct.library_version_hash {
26520 let val = buf.get_u8()?;
26521 *v = val;
26522 }
26523 Ok(__struct)
26524 }
26525 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26526 let mut __tmp = BytesMut::new(bytes);
26527 #[allow(clippy::absurd_extreme_comparisons)]
26528 #[allow(unused_comparisons)]
26529 if __tmp.remaining() < Self::ENCODED_LEN {
26530 panic!(
26531 "buffer is too small (need {} bytes, but got {})",
26532 Self::ENCODED_LEN,
26533 __tmp.remaining(),
26534 )
26535 }
26536 __tmp.put_u16_le(self.version);
26537 __tmp.put_u16_le(self.min_version);
26538 __tmp.put_u16_le(self.max_version);
26539 for val in &self.spec_version_hash {
26540 __tmp.put_u8(*val);
26541 }
26542 for val in &self.library_version_hash {
26543 __tmp.put_u8(*val);
26544 }
26545 if matches!(version, MavlinkVersion::V2) {
26546 let len = __tmp.len();
26547 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26548 } else {
26549 __tmp.len()
26550 }
26551 }
26552}
26553#[doc = "Status generated by radio and injected into MAVLink stream."]
26554#[doc = ""]
26555#[doc = "ID: 109"]
26556#[derive(Debug, Clone, PartialEq)]
26557#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26558#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26559#[cfg_attr(feature = "ts", derive(TS))]
26560#[cfg_attr(feature = "ts", ts(export))]
26561pub struct RADIO_STATUS_DATA {
26562 #[doc = "Count of radio packet receive errors (since boot)."]
26563 pub rxerrors: u16,
26564 #[doc = "Count of error corrected radio packets (since boot)."]
26565 pub fixed: u16,
26566 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26567 pub rssi: u8,
26568 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26569 pub remrssi: u8,
26570 #[doc = "Remaining free transmitter buffer space."]
26571 pub txbuf: u8,
26572 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
26573 pub noise: u8,
26574 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
26575 pub remnoise: u8,
26576}
26577impl RADIO_STATUS_DATA {
26578 pub const ENCODED_LEN: usize = 9usize;
26579 pub const DEFAULT: Self = Self {
26580 rxerrors: 0_u16,
26581 fixed: 0_u16,
26582 rssi: 0_u8,
26583 remrssi: 0_u8,
26584 txbuf: 0_u8,
26585 noise: 0_u8,
26586 remnoise: 0_u8,
26587 };
26588 #[cfg(feature = "arbitrary")]
26589 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26590 use arbitrary::{Arbitrary, Unstructured};
26591 let mut buf = [0u8; 1024];
26592 rng.fill_bytes(&mut buf);
26593 let mut unstructured = Unstructured::new(&buf);
26594 Self::arbitrary(&mut unstructured).unwrap_or_default()
26595 }
26596}
26597impl Default for RADIO_STATUS_DATA {
26598 fn default() -> Self {
26599 Self::DEFAULT.clone()
26600 }
26601}
26602impl MessageData for RADIO_STATUS_DATA {
26603 type Message = MavMessage;
26604 const ID: u32 = 109u32;
26605 const NAME: &'static str = "RADIO_STATUS";
26606 const EXTRA_CRC: u8 = 185u8;
26607 const ENCODED_LEN: usize = 9usize;
26608 fn deser(
26609 _version: MavlinkVersion,
26610 __input: &[u8],
26611 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26612 let avail_len = __input.len();
26613 let mut payload_buf = [0; Self::ENCODED_LEN];
26614 let mut buf = if avail_len < Self::ENCODED_LEN {
26615 payload_buf[0..avail_len].copy_from_slice(__input);
26616 Bytes::new(&payload_buf)
26617 } else {
26618 Bytes::new(__input)
26619 };
26620 let mut __struct = Self::default();
26621 __struct.rxerrors = buf.get_u16_le()?;
26622 __struct.fixed = buf.get_u16_le()?;
26623 __struct.rssi = buf.get_u8()?;
26624 __struct.remrssi = buf.get_u8()?;
26625 __struct.txbuf = buf.get_u8()?;
26626 __struct.noise = buf.get_u8()?;
26627 __struct.remnoise = buf.get_u8()?;
26628 Ok(__struct)
26629 }
26630 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26631 let mut __tmp = BytesMut::new(bytes);
26632 #[allow(clippy::absurd_extreme_comparisons)]
26633 #[allow(unused_comparisons)]
26634 if __tmp.remaining() < Self::ENCODED_LEN {
26635 panic!(
26636 "buffer is too small (need {} bytes, but got {})",
26637 Self::ENCODED_LEN,
26638 __tmp.remaining(),
26639 )
26640 }
26641 __tmp.put_u16_le(self.rxerrors);
26642 __tmp.put_u16_le(self.fixed);
26643 __tmp.put_u8(self.rssi);
26644 __tmp.put_u8(self.remrssi);
26645 __tmp.put_u8(self.txbuf);
26646 __tmp.put_u8(self.noise);
26647 __tmp.put_u8(self.remnoise);
26648 if matches!(version, MavlinkVersion::V2) {
26649 let len = __tmp.len();
26650 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26651 } else {
26652 __tmp.len()
26653 }
26654 }
26655}
26656#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
26657#[doc = ""]
26658#[doc = "ID: 27"]
26659#[derive(Debug, Clone, PartialEq)]
26660#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26661#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26662#[cfg_attr(feature = "ts", derive(TS))]
26663#[cfg_attr(feature = "ts", ts(export))]
26664pub struct RAW_IMU_DATA {
26665 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26666 pub time_usec: u64,
26667 #[doc = "X acceleration (raw)"]
26668 pub xacc: i16,
26669 #[doc = "Y acceleration (raw)"]
26670 pub yacc: i16,
26671 #[doc = "Z acceleration (raw)"]
26672 pub zacc: i16,
26673 #[doc = "Angular speed around X axis (raw)"]
26674 pub xgyro: i16,
26675 #[doc = "Angular speed around Y axis (raw)"]
26676 pub ygyro: i16,
26677 #[doc = "Angular speed around Z axis (raw)"]
26678 pub zgyro: i16,
26679 #[doc = "X Magnetic field (raw)"]
26680 pub xmag: i16,
26681 #[doc = "Y Magnetic field (raw)"]
26682 pub ymag: i16,
26683 #[doc = "Z Magnetic field (raw)"]
26684 pub zmag: i16,
26685 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
26686 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26687 pub id: u8,
26688 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26689 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26690 pub temperature: i16,
26691}
26692impl RAW_IMU_DATA {
26693 pub const ENCODED_LEN: usize = 29usize;
26694 pub const DEFAULT: Self = Self {
26695 time_usec: 0_u64,
26696 xacc: 0_i16,
26697 yacc: 0_i16,
26698 zacc: 0_i16,
26699 xgyro: 0_i16,
26700 ygyro: 0_i16,
26701 zgyro: 0_i16,
26702 xmag: 0_i16,
26703 ymag: 0_i16,
26704 zmag: 0_i16,
26705 id: 0_u8,
26706 temperature: 0_i16,
26707 };
26708 #[cfg(feature = "arbitrary")]
26709 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26710 use arbitrary::{Arbitrary, Unstructured};
26711 let mut buf = [0u8; 1024];
26712 rng.fill_bytes(&mut buf);
26713 let mut unstructured = Unstructured::new(&buf);
26714 Self::arbitrary(&mut unstructured).unwrap_or_default()
26715 }
26716}
26717impl Default for RAW_IMU_DATA {
26718 fn default() -> Self {
26719 Self::DEFAULT.clone()
26720 }
26721}
26722impl MessageData for RAW_IMU_DATA {
26723 type Message = MavMessage;
26724 const ID: u32 = 27u32;
26725 const NAME: &'static str = "RAW_IMU";
26726 const EXTRA_CRC: u8 = 144u8;
26727 const ENCODED_LEN: usize = 29usize;
26728 fn deser(
26729 _version: MavlinkVersion,
26730 __input: &[u8],
26731 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26732 let avail_len = __input.len();
26733 let mut payload_buf = [0; Self::ENCODED_LEN];
26734 let mut buf = if avail_len < Self::ENCODED_LEN {
26735 payload_buf[0..avail_len].copy_from_slice(__input);
26736 Bytes::new(&payload_buf)
26737 } else {
26738 Bytes::new(__input)
26739 };
26740 let mut __struct = Self::default();
26741 __struct.time_usec = buf.get_u64_le()?;
26742 __struct.xacc = buf.get_i16_le()?;
26743 __struct.yacc = buf.get_i16_le()?;
26744 __struct.zacc = buf.get_i16_le()?;
26745 __struct.xgyro = buf.get_i16_le()?;
26746 __struct.ygyro = buf.get_i16_le()?;
26747 __struct.zgyro = buf.get_i16_le()?;
26748 __struct.xmag = buf.get_i16_le()?;
26749 __struct.ymag = buf.get_i16_le()?;
26750 __struct.zmag = buf.get_i16_le()?;
26751 __struct.id = buf.get_u8()?;
26752 __struct.temperature = buf.get_i16_le()?;
26753 Ok(__struct)
26754 }
26755 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26756 let mut __tmp = BytesMut::new(bytes);
26757 #[allow(clippy::absurd_extreme_comparisons)]
26758 #[allow(unused_comparisons)]
26759 if __tmp.remaining() < Self::ENCODED_LEN {
26760 panic!(
26761 "buffer is too small (need {} bytes, but got {})",
26762 Self::ENCODED_LEN,
26763 __tmp.remaining(),
26764 )
26765 }
26766 __tmp.put_u64_le(self.time_usec);
26767 __tmp.put_i16_le(self.xacc);
26768 __tmp.put_i16_le(self.yacc);
26769 __tmp.put_i16_le(self.zacc);
26770 __tmp.put_i16_le(self.xgyro);
26771 __tmp.put_i16_le(self.ygyro);
26772 __tmp.put_i16_le(self.zgyro);
26773 __tmp.put_i16_le(self.xmag);
26774 __tmp.put_i16_le(self.ymag);
26775 __tmp.put_i16_le(self.zmag);
26776 if matches!(version, MavlinkVersion::V2) {
26777 __tmp.put_u8(self.id);
26778 __tmp.put_i16_le(self.temperature);
26779 let len = __tmp.len();
26780 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26781 } else {
26782 __tmp.len()
26783 }
26784 }
26785}
26786#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
26787#[doc = ""]
26788#[doc = "ID: 28"]
26789#[derive(Debug, Clone, PartialEq)]
26790#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26791#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26792#[cfg_attr(feature = "ts", derive(TS))]
26793#[cfg_attr(feature = "ts", ts(export))]
26794pub struct RAW_PRESSURE_DATA {
26795 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26796 pub time_usec: u64,
26797 #[doc = "Absolute pressure (raw)"]
26798 pub press_abs: i16,
26799 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
26800 pub press_diff1: i16,
26801 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
26802 pub press_diff2: i16,
26803 #[doc = "Raw Temperature measurement (raw)"]
26804 pub temperature: i16,
26805}
26806impl RAW_PRESSURE_DATA {
26807 pub const ENCODED_LEN: usize = 16usize;
26808 pub const DEFAULT: Self = Self {
26809 time_usec: 0_u64,
26810 press_abs: 0_i16,
26811 press_diff1: 0_i16,
26812 press_diff2: 0_i16,
26813 temperature: 0_i16,
26814 };
26815 #[cfg(feature = "arbitrary")]
26816 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26817 use arbitrary::{Arbitrary, Unstructured};
26818 let mut buf = [0u8; 1024];
26819 rng.fill_bytes(&mut buf);
26820 let mut unstructured = Unstructured::new(&buf);
26821 Self::arbitrary(&mut unstructured).unwrap_or_default()
26822 }
26823}
26824impl Default for RAW_PRESSURE_DATA {
26825 fn default() -> Self {
26826 Self::DEFAULT.clone()
26827 }
26828}
26829impl MessageData for RAW_PRESSURE_DATA {
26830 type Message = MavMessage;
26831 const ID: u32 = 28u32;
26832 const NAME: &'static str = "RAW_PRESSURE";
26833 const EXTRA_CRC: u8 = 67u8;
26834 const ENCODED_LEN: usize = 16usize;
26835 fn deser(
26836 _version: MavlinkVersion,
26837 __input: &[u8],
26838 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26839 let avail_len = __input.len();
26840 let mut payload_buf = [0; Self::ENCODED_LEN];
26841 let mut buf = if avail_len < Self::ENCODED_LEN {
26842 payload_buf[0..avail_len].copy_from_slice(__input);
26843 Bytes::new(&payload_buf)
26844 } else {
26845 Bytes::new(__input)
26846 };
26847 let mut __struct = Self::default();
26848 __struct.time_usec = buf.get_u64_le()?;
26849 __struct.press_abs = buf.get_i16_le()?;
26850 __struct.press_diff1 = buf.get_i16_le()?;
26851 __struct.press_diff2 = buf.get_i16_le()?;
26852 __struct.temperature = buf.get_i16_le()?;
26853 Ok(__struct)
26854 }
26855 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26856 let mut __tmp = BytesMut::new(bytes);
26857 #[allow(clippy::absurd_extreme_comparisons)]
26858 #[allow(unused_comparisons)]
26859 if __tmp.remaining() < Self::ENCODED_LEN {
26860 panic!(
26861 "buffer is too small (need {} bytes, but got {})",
26862 Self::ENCODED_LEN,
26863 __tmp.remaining(),
26864 )
26865 }
26866 __tmp.put_u64_le(self.time_usec);
26867 __tmp.put_i16_le(self.press_abs);
26868 __tmp.put_i16_le(self.press_diff1);
26869 __tmp.put_i16_le(self.press_diff2);
26870 __tmp.put_i16_le(self.temperature);
26871 if matches!(version, MavlinkVersion::V2) {
26872 let len = __tmp.len();
26873 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26874 } else {
26875 __tmp.len()
26876 }
26877 }
26878}
26879#[doc = "RPM sensor data message."]
26880#[doc = ""]
26881#[doc = "ID: 339"]
26882#[derive(Debug, Clone, PartialEq)]
26883#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26884#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26885#[cfg_attr(feature = "ts", derive(TS))]
26886#[cfg_attr(feature = "ts", ts(export))]
26887pub struct RAW_RPM_DATA {
26888 #[doc = "Indicated rate"]
26889 pub frequency: f32,
26890 #[doc = "Index of this RPM sensor (0-indexed)"]
26891 pub index: u8,
26892}
26893impl RAW_RPM_DATA {
26894 pub const ENCODED_LEN: usize = 5usize;
26895 pub const DEFAULT: Self = Self {
26896 frequency: 0.0_f32,
26897 index: 0_u8,
26898 };
26899 #[cfg(feature = "arbitrary")]
26900 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26901 use arbitrary::{Arbitrary, Unstructured};
26902 let mut buf = [0u8; 1024];
26903 rng.fill_bytes(&mut buf);
26904 let mut unstructured = Unstructured::new(&buf);
26905 Self::arbitrary(&mut unstructured).unwrap_or_default()
26906 }
26907}
26908impl Default for RAW_RPM_DATA {
26909 fn default() -> Self {
26910 Self::DEFAULT.clone()
26911 }
26912}
26913impl MessageData for RAW_RPM_DATA {
26914 type Message = MavMessage;
26915 const ID: u32 = 339u32;
26916 const NAME: &'static str = "RAW_RPM";
26917 const EXTRA_CRC: u8 = 199u8;
26918 const ENCODED_LEN: usize = 5usize;
26919 fn deser(
26920 _version: MavlinkVersion,
26921 __input: &[u8],
26922 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26923 let avail_len = __input.len();
26924 let mut payload_buf = [0; Self::ENCODED_LEN];
26925 let mut buf = if avail_len < Self::ENCODED_LEN {
26926 payload_buf[0..avail_len].copy_from_slice(__input);
26927 Bytes::new(&payload_buf)
26928 } else {
26929 Bytes::new(__input)
26930 };
26931 let mut __struct = Self::default();
26932 __struct.frequency = buf.get_f32_le()?;
26933 __struct.index = buf.get_u8()?;
26934 Ok(__struct)
26935 }
26936 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26937 let mut __tmp = BytesMut::new(bytes);
26938 #[allow(clippy::absurd_extreme_comparisons)]
26939 #[allow(unused_comparisons)]
26940 if __tmp.remaining() < Self::ENCODED_LEN {
26941 panic!(
26942 "buffer is too small (need {} bytes, but got {})",
26943 Self::ENCODED_LEN,
26944 __tmp.remaining(),
26945 )
26946 }
26947 __tmp.put_f32_le(self.frequency);
26948 __tmp.put_u8(self.index);
26949 if matches!(version, MavlinkVersion::V2) {
26950 let len = __tmp.len();
26951 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26952 } else {
26953 __tmp.len()
26954 }
26955 }
26956}
26957#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
26958#[doc = ""]
26959#[doc = "ID: 65"]
26960#[derive(Debug, Clone, PartialEq)]
26961#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26962#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26963#[cfg_attr(feature = "ts", derive(TS))]
26964#[cfg_attr(feature = "ts", ts(export))]
26965pub struct RC_CHANNELS_DATA {
26966 #[doc = "Timestamp (time since system boot)."]
26967 pub time_boot_ms: u32,
26968 #[doc = "RC channel 1 value."]
26969 pub chan1_raw: u16,
26970 #[doc = "RC channel 2 value."]
26971 pub chan2_raw: u16,
26972 #[doc = "RC channel 3 value."]
26973 pub chan3_raw: u16,
26974 #[doc = "RC channel 4 value."]
26975 pub chan4_raw: u16,
26976 #[doc = "RC channel 5 value."]
26977 pub chan5_raw: u16,
26978 #[doc = "RC channel 6 value."]
26979 pub chan6_raw: u16,
26980 #[doc = "RC channel 7 value."]
26981 pub chan7_raw: u16,
26982 #[doc = "RC channel 8 value."]
26983 pub chan8_raw: u16,
26984 #[doc = "RC channel 9 value."]
26985 pub chan9_raw: u16,
26986 #[doc = "RC channel 10 value."]
26987 pub chan10_raw: u16,
26988 #[doc = "RC channel 11 value."]
26989 pub chan11_raw: u16,
26990 #[doc = "RC channel 12 value."]
26991 pub chan12_raw: u16,
26992 #[doc = "RC channel 13 value."]
26993 pub chan13_raw: u16,
26994 #[doc = "RC channel 14 value."]
26995 pub chan14_raw: u16,
26996 #[doc = "RC channel 15 value."]
26997 pub chan15_raw: u16,
26998 #[doc = "RC channel 16 value."]
26999 pub chan16_raw: u16,
27000 #[doc = "RC channel 17 value."]
27001 pub chan17_raw: u16,
27002 #[doc = "RC channel 18 value."]
27003 pub chan18_raw: u16,
27004 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
27005 pub chancount: u8,
27006 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
27007 pub rssi: u8,
27008}
27009impl RC_CHANNELS_DATA {
27010 pub const ENCODED_LEN: usize = 42usize;
27011 pub const DEFAULT: Self = Self {
27012 time_boot_ms: 0_u32,
27013 chan1_raw: 0_u16,
27014 chan2_raw: 0_u16,
27015 chan3_raw: 0_u16,
27016 chan4_raw: 0_u16,
27017 chan5_raw: 0_u16,
27018 chan6_raw: 0_u16,
27019 chan7_raw: 0_u16,
27020 chan8_raw: 0_u16,
27021 chan9_raw: 0_u16,
27022 chan10_raw: 0_u16,
27023 chan11_raw: 0_u16,
27024 chan12_raw: 0_u16,
27025 chan13_raw: 0_u16,
27026 chan14_raw: 0_u16,
27027 chan15_raw: 0_u16,
27028 chan16_raw: 0_u16,
27029 chan17_raw: 0_u16,
27030 chan18_raw: 0_u16,
27031 chancount: 0_u8,
27032 rssi: 0_u8,
27033 };
27034 #[cfg(feature = "arbitrary")]
27035 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27036 use arbitrary::{Arbitrary, Unstructured};
27037 let mut buf = [0u8; 1024];
27038 rng.fill_bytes(&mut buf);
27039 let mut unstructured = Unstructured::new(&buf);
27040 Self::arbitrary(&mut unstructured).unwrap_or_default()
27041 }
27042}
27043impl Default for RC_CHANNELS_DATA {
27044 fn default() -> Self {
27045 Self::DEFAULT.clone()
27046 }
27047}
27048impl MessageData for RC_CHANNELS_DATA {
27049 type Message = MavMessage;
27050 const ID: u32 = 65u32;
27051 const NAME: &'static str = "RC_CHANNELS";
27052 const EXTRA_CRC: u8 = 118u8;
27053 const ENCODED_LEN: usize = 42usize;
27054 fn deser(
27055 _version: MavlinkVersion,
27056 __input: &[u8],
27057 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27058 let avail_len = __input.len();
27059 let mut payload_buf = [0; Self::ENCODED_LEN];
27060 let mut buf = if avail_len < Self::ENCODED_LEN {
27061 payload_buf[0..avail_len].copy_from_slice(__input);
27062 Bytes::new(&payload_buf)
27063 } else {
27064 Bytes::new(__input)
27065 };
27066 let mut __struct = Self::default();
27067 __struct.time_boot_ms = buf.get_u32_le()?;
27068 __struct.chan1_raw = buf.get_u16_le()?;
27069 __struct.chan2_raw = buf.get_u16_le()?;
27070 __struct.chan3_raw = buf.get_u16_le()?;
27071 __struct.chan4_raw = buf.get_u16_le()?;
27072 __struct.chan5_raw = buf.get_u16_le()?;
27073 __struct.chan6_raw = buf.get_u16_le()?;
27074 __struct.chan7_raw = buf.get_u16_le()?;
27075 __struct.chan8_raw = buf.get_u16_le()?;
27076 __struct.chan9_raw = buf.get_u16_le()?;
27077 __struct.chan10_raw = buf.get_u16_le()?;
27078 __struct.chan11_raw = buf.get_u16_le()?;
27079 __struct.chan12_raw = buf.get_u16_le()?;
27080 __struct.chan13_raw = buf.get_u16_le()?;
27081 __struct.chan14_raw = buf.get_u16_le()?;
27082 __struct.chan15_raw = buf.get_u16_le()?;
27083 __struct.chan16_raw = buf.get_u16_le()?;
27084 __struct.chan17_raw = buf.get_u16_le()?;
27085 __struct.chan18_raw = buf.get_u16_le()?;
27086 __struct.chancount = buf.get_u8()?;
27087 __struct.rssi = buf.get_u8()?;
27088 Ok(__struct)
27089 }
27090 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27091 let mut __tmp = BytesMut::new(bytes);
27092 #[allow(clippy::absurd_extreme_comparisons)]
27093 #[allow(unused_comparisons)]
27094 if __tmp.remaining() < Self::ENCODED_LEN {
27095 panic!(
27096 "buffer is too small (need {} bytes, but got {})",
27097 Self::ENCODED_LEN,
27098 __tmp.remaining(),
27099 )
27100 }
27101 __tmp.put_u32_le(self.time_boot_ms);
27102 __tmp.put_u16_le(self.chan1_raw);
27103 __tmp.put_u16_le(self.chan2_raw);
27104 __tmp.put_u16_le(self.chan3_raw);
27105 __tmp.put_u16_le(self.chan4_raw);
27106 __tmp.put_u16_le(self.chan5_raw);
27107 __tmp.put_u16_le(self.chan6_raw);
27108 __tmp.put_u16_le(self.chan7_raw);
27109 __tmp.put_u16_le(self.chan8_raw);
27110 __tmp.put_u16_le(self.chan9_raw);
27111 __tmp.put_u16_le(self.chan10_raw);
27112 __tmp.put_u16_le(self.chan11_raw);
27113 __tmp.put_u16_le(self.chan12_raw);
27114 __tmp.put_u16_le(self.chan13_raw);
27115 __tmp.put_u16_le(self.chan14_raw);
27116 __tmp.put_u16_le(self.chan15_raw);
27117 __tmp.put_u16_le(self.chan16_raw);
27118 __tmp.put_u16_le(self.chan17_raw);
27119 __tmp.put_u16_le(self.chan18_raw);
27120 __tmp.put_u8(self.chancount);
27121 __tmp.put_u8(self.rssi);
27122 if matches!(version, MavlinkVersion::V2) {
27123 let len = __tmp.len();
27124 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27125 } else {
27126 __tmp.len()
27127 }
27128 }
27129}
27130#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
27131#[doc = ""]
27132#[doc = "ID: 70"]
27133#[derive(Debug, Clone, PartialEq)]
27134#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27135#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27136#[cfg_attr(feature = "ts", derive(TS))]
27137#[cfg_attr(feature = "ts", ts(export))]
27138pub struct RC_CHANNELS_OVERRIDE_DATA {
27139 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
27140 pub chan1_raw: u16,
27141 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
27142 pub chan2_raw: u16,
27143 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
27144 pub chan3_raw: u16,
27145 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
27146 pub chan4_raw: u16,
27147 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
27148 pub chan5_raw: u16,
27149 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
27150 pub chan6_raw: u16,
27151 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
27152 pub chan7_raw: u16,
27153 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
27154 pub chan8_raw: u16,
27155 #[doc = "System ID"]
27156 pub target_system: u8,
27157 #[doc = "Component ID"]
27158 pub target_component: u8,
27159 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
27160 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27161 pub chan9_raw: u16,
27162 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
27163 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27164 pub chan10_raw: u16,
27165 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
27166 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27167 pub chan11_raw: u16,
27168 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
27169 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27170 pub chan12_raw: u16,
27171 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
27172 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27173 pub chan13_raw: u16,
27174 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
27175 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27176 pub chan14_raw: u16,
27177 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
27178 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27179 pub chan15_raw: u16,
27180 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
27181 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27182 pub chan16_raw: u16,
27183 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
27184 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27185 pub chan17_raw: u16,
27186 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
27187 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27188 pub chan18_raw: u16,
27189}
27190impl RC_CHANNELS_OVERRIDE_DATA {
27191 pub const ENCODED_LEN: usize = 38usize;
27192 pub const DEFAULT: Self = Self {
27193 chan1_raw: 0_u16,
27194 chan2_raw: 0_u16,
27195 chan3_raw: 0_u16,
27196 chan4_raw: 0_u16,
27197 chan5_raw: 0_u16,
27198 chan6_raw: 0_u16,
27199 chan7_raw: 0_u16,
27200 chan8_raw: 0_u16,
27201 target_system: 0_u8,
27202 target_component: 0_u8,
27203 chan9_raw: 0_u16,
27204 chan10_raw: 0_u16,
27205 chan11_raw: 0_u16,
27206 chan12_raw: 0_u16,
27207 chan13_raw: 0_u16,
27208 chan14_raw: 0_u16,
27209 chan15_raw: 0_u16,
27210 chan16_raw: 0_u16,
27211 chan17_raw: 0_u16,
27212 chan18_raw: 0_u16,
27213 };
27214 #[cfg(feature = "arbitrary")]
27215 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27216 use arbitrary::{Arbitrary, Unstructured};
27217 let mut buf = [0u8; 1024];
27218 rng.fill_bytes(&mut buf);
27219 let mut unstructured = Unstructured::new(&buf);
27220 Self::arbitrary(&mut unstructured).unwrap_or_default()
27221 }
27222}
27223impl Default for RC_CHANNELS_OVERRIDE_DATA {
27224 fn default() -> Self {
27225 Self::DEFAULT.clone()
27226 }
27227}
27228impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
27229 type Message = MavMessage;
27230 const ID: u32 = 70u32;
27231 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
27232 const EXTRA_CRC: u8 = 124u8;
27233 const ENCODED_LEN: usize = 38usize;
27234 fn deser(
27235 _version: MavlinkVersion,
27236 __input: &[u8],
27237 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27238 let avail_len = __input.len();
27239 let mut payload_buf = [0; Self::ENCODED_LEN];
27240 let mut buf = if avail_len < Self::ENCODED_LEN {
27241 payload_buf[0..avail_len].copy_from_slice(__input);
27242 Bytes::new(&payload_buf)
27243 } else {
27244 Bytes::new(__input)
27245 };
27246 let mut __struct = Self::default();
27247 __struct.chan1_raw = buf.get_u16_le()?;
27248 __struct.chan2_raw = buf.get_u16_le()?;
27249 __struct.chan3_raw = buf.get_u16_le()?;
27250 __struct.chan4_raw = buf.get_u16_le()?;
27251 __struct.chan5_raw = buf.get_u16_le()?;
27252 __struct.chan6_raw = buf.get_u16_le()?;
27253 __struct.chan7_raw = buf.get_u16_le()?;
27254 __struct.chan8_raw = buf.get_u16_le()?;
27255 __struct.target_system = buf.get_u8()?;
27256 __struct.target_component = buf.get_u8()?;
27257 __struct.chan9_raw = buf.get_u16_le()?;
27258 __struct.chan10_raw = buf.get_u16_le()?;
27259 __struct.chan11_raw = buf.get_u16_le()?;
27260 __struct.chan12_raw = buf.get_u16_le()?;
27261 __struct.chan13_raw = buf.get_u16_le()?;
27262 __struct.chan14_raw = buf.get_u16_le()?;
27263 __struct.chan15_raw = buf.get_u16_le()?;
27264 __struct.chan16_raw = buf.get_u16_le()?;
27265 __struct.chan17_raw = buf.get_u16_le()?;
27266 __struct.chan18_raw = buf.get_u16_le()?;
27267 Ok(__struct)
27268 }
27269 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27270 let mut __tmp = BytesMut::new(bytes);
27271 #[allow(clippy::absurd_extreme_comparisons)]
27272 #[allow(unused_comparisons)]
27273 if __tmp.remaining() < Self::ENCODED_LEN {
27274 panic!(
27275 "buffer is too small (need {} bytes, but got {})",
27276 Self::ENCODED_LEN,
27277 __tmp.remaining(),
27278 )
27279 }
27280 __tmp.put_u16_le(self.chan1_raw);
27281 __tmp.put_u16_le(self.chan2_raw);
27282 __tmp.put_u16_le(self.chan3_raw);
27283 __tmp.put_u16_le(self.chan4_raw);
27284 __tmp.put_u16_le(self.chan5_raw);
27285 __tmp.put_u16_le(self.chan6_raw);
27286 __tmp.put_u16_le(self.chan7_raw);
27287 __tmp.put_u16_le(self.chan8_raw);
27288 __tmp.put_u8(self.target_system);
27289 __tmp.put_u8(self.target_component);
27290 if matches!(version, MavlinkVersion::V2) {
27291 __tmp.put_u16_le(self.chan9_raw);
27292 __tmp.put_u16_le(self.chan10_raw);
27293 __tmp.put_u16_le(self.chan11_raw);
27294 __tmp.put_u16_le(self.chan12_raw);
27295 __tmp.put_u16_le(self.chan13_raw);
27296 __tmp.put_u16_le(self.chan14_raw);
27297 __tmp.put_u16_le(self.chan15_raw);
27298 __tmp.put_u16_le(self.chan16_raw);
27299 __tmp.put_u16_le(self.chan17_raw);
27300 __tmp.put_u16_le(self.chan18_raw);
27301 let len = __tmp.len();
27302 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27303 } else {
27304 __tmp.len()
27305 }
27306 }
27307}
27308#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
27309#[doc = ""]
27310#[doc = "ID: 35"]
27311#[derive(Debug, Clone, PartialEq)]
27312#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27314#[cfg_attr(feature = "ts", derive(TS))]
27315#[cfg_attr(feature = "ts", ts(export))]
27316pub struct RC_CHANNELS_RAW_DATA {
27317 #[doc = "Timestamp (time since system boot)."]
27318 pub time_boot_ms: u32,
27319 #[doc = "RC channel 1 value."]
27320 pub chan1_raw: u16,
27321 #[doc = "RC channel 2 value."]
27322 pub chan2_raw: u16,
27323 #[doc = "RC channel 3 value."]
27324 pub chan3_raw: u16,
27325 #[doc = "RC channel 4 value."]
27326 pub chan4_raw: u16,
27327 #[doc = "RC channel 5 value."]
27328 pub chan5_raw: u16,
27329 #[doc = "RC channel 6 value."]
27330 pub chan6_raw: u16,
27331 #[doc = "RC channel 7 value."]
27332 pub chan7_raw: u16,
27333 #[doc = "RC channel 8 value."]
27334 pub chan8_raw: u16,
27335 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
27336 pub port: u8,
27337 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
27338 pub rssi: u8,
27339}
27340impl RC_CHANNELS_RAW_DATA {
27341 pub const ENCODED_LEN: usize = 22usize;
27342 pub const DEFAULT: Self = Self {
27343 time_boot_ms: 0_u32,
27344 chan1_raw: 0_u16,
27345 chan2_raw: 0_u16,
27346 chan3_raw: 0_u16,
27347 chan4_raw: 0_u16,
27348 chan5_raw: 0_u16,
27349 chan6_raw: 0_u16,
27350 chan7_raw: 0_u16,
27351 chan8_raw: 0_u16,
27352 port: 0_u8,
27353 rssi: 0_u8,
27354 };
27355 #[cfg(feature = "arbitrary")]
27356 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27357 use arbitrary::{Arbitrary, Unstructured};
27358 let mut buf = [0u8; 1024];
27359 rng.fill_bytes(&mut buf);
27360 let mut unstructured = Unstructured::new(&buf);
27361 Self::arbitrary(&mut unstructured).unwrap_or_default()
27362 }
27363}
27364impl Default for RC_CHANNELS_RAW_DATA {
27365 fn default() -> Self {
27366 Self::DEFAULT.clone()
27367 }
27368}
27369impl MessageData for RC_CHANNELS_RAW_DATA {
27370 type Message = MavMessage;
27371 const ID: u32 = 35u32;
27372 const NAME: &'static str = "RC_CHANNELS_RAW";
27373 const EXTRA_CRC: u8 = 244u8;
27374 const ENCODED_LEN: usize = 22usize;
27375 fn deser(
27376 _version: MavlinkVersion,
27377 __input: &[u8],
27378 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27379 let avail_len = __input.len();
27380 let mut payload_buf = [0; Self::ENCODED_LEN];
27381 let mut buf = if avail_len < Self::ENCODED_LEN {
27382 payload_buf[0..avail_len].copy_from_slice(__input);
27383 Bytes::new(&payload_buf)
27384 } else {
27385 Bytes::new(__input)
27386 };
27387 let mut __struct = Self::default();
27388 __struct.time_boot_ms = buf.get_u32_le()?;
27389 __struct.chan1_raw = buf.get_u16_le()?;
27390 __struct.chan2_raw = buf.get_u16_le()?;
27391 __struct.chan3_raw = buf.get_u16_le()?;
27392 __struct.chan4_raw = buf.get_u16_le()?;
27393 __struct.chan5_raw = buf.get_u16_le()?;
27394 __struct.chan6_raw = buf.get_u16_le()?;
27395 __struct.chan7_raw = buf.get_u16_le()?;
27396 __struct.chan8_raw = buf.get_u16_le()?;
27397 __struct.port = buf.get_u8()?;
27398 __struct.rssi = buf.get_u8()?;
27399 Ok(__struct)
27400 }
27401 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27402 let mut __tmp = BytesMut::new(bytes);
27403 #[allow(clippy::absurd_extreme_comparisons)]
27404 #[allow(unused_comparisons)]
27405 if __tmp.remaining() < Self::ENCODED_LEN {
27406 panic!(
27407 "buffer is too small (need {} bytes, but got {})",
27408 Self::ENCODED_LEN,
27409 __tmp.remaining(),
27410 )
27411 }
27412 __tmp.put_u32_le(self.time_boot_ms);
27413 __tmp.put_u16_le(self.chan1_raw);
27414 __tmp.put_u16_le(self.chan2_raw);
27415 __tmp.put_u16_le(self.chan3_raw);
27416 __tmp.put_u16_le(self.chan4_raw);
27417 __tmp.put_u16_le(self.chan5_raw);
27418 __tmp.put_u16_le(self.chan6_raw);
27419 __tmp.put_u16_le(self.chan7_raw);
27420 __tmp.put_u16_le(self.chan8_raw);
27421 __tmp.put_u8(self.port);
27422 __tmp.put_u8(self.rssi);
27423 if matches!(version, MavlinkVersion::V2) {
27424 let len = __tmp.len();
27425 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27426 } else {
27427 __tmp.len()
27428 }
27429 }
27430}
27431#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
27432#[doc = ""]
27433#[doc = "ID: 34"]
27434#[derive(Debug, Clone, PartialEq)]
27435#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27436#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27437#[cfg_attr(feature = "ts", derive(TS))]
27438#[cfg_attr(feature = "ts", ts(export))]
27439pub struct RC_CHANNELS_SCALED_DATA {
27440 #[doc = "Timestamp (time since system boot)."]
27441 pub time_boot_ms: u32,
27442 #[doc = "RC channel 1 value scaled."]
27443 pub chan1_scaled: i16,
27444 #[doc = "RC channel 2 value scaled."]
27445 pub chan2_scaled: i16,
27446 #[doc = "RC channel 3 value scaled."]
27447 pub chan3_scaled: i16,
27448 #[doc = "RC channel 4 value scaled."]
27449 pub chan4_scaled: i16,
27450 #[doc = "RC channel 5 value scaled."]
27451 pub chan5_scaled: i16,
27452 #[doc = "RC channel 6 value scaled."]
27453 pub chan6_scaled: i16,
27454 #[doc = "RC channel 7 value scaled."]
27455 pub chan7_scaled: i16,
27456 #[doc = "RC channel 8 value scaled."]
27457 pub chan8_scaled: i16,
27458 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
27459 pub port: u8,
27460 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
27461 pub rssi: u8,
27462}
27463impl RC_CHANNELS_SCALED_DATA {
27464 pub const ENCODED_LEN: usize = 22usize;
27465 pub const DEFAULT: Self = Self {
27466 time_boot_ms: 0_u32,
27467 chan1_scaled: 0_i16,
27468 chan2_scaled: 0_i16,
27469 chan3_scaled: 0_i16,
27470 chan4_scaled: 0_i16,
27471 chan5_scaled: 0_i16,
27472 chan6_scaled: 0_i16,
27473 chan7_scaled: 0_i16,
27474 chan8_scaled: 0_i16,
27475 port: 0_u8,
27476 rssi: 0_u8,
27477 };
27478 #[cfg(feature = "arbitrary")]
27479 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27480 use arbitrary::{Arbitrary, Unstructured};
27481 let mut buf = [0u8; 1024];
27482 rng.fill_bytes(&mut buf);
27483 let mut unstructured = Unstructured::new(&buf);
27484 Self::arbitrary(&mut unstructured).unwrap_or_default()
27485 }
27486}
27487impl Default for RC_CHANNELS_SCALED_DATA {
27488 fn default() -> Self {
27489 Self::DEFAULT.clone()
27490 }
27491}
27492impl MessageData for RC_CHANNELS_SCALED_DATA {
27493 type Message = MavMessage;
27494 const ID: u32 = 34u32;
27495 const NAME: &'static str = "RC_CHANNELS_SCALED";
27496 const EXTRA_CRC: u8 = 237u8;
27497 const ENCODED_LEN: usize = 22usize;
27498 fn deser(
27499 _version: MavlinkVersion,
27500 __input: &[u8],
27501 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27502 let avail_len = __input.len();
27503 let mut payload_buf = [0; Self::ENCODED_LEN];
27504 let mut buf = if avail_len < Self::ENCODED_LEN {
27505 payload_buf[0..avail_len].copy_from_slice(__input);
27506 Bytes::new(&payload_buf)
27507 } else {
27508 Bytes::new(__input)
27509 };
27510 let mut __struct = Self::default();
27511 __struct.time_boot_ms = buf.get_u32_le()?;
27512 __struct.chan1_scaled = buf.get_i16_le()?;
27513 __struct.chan2_scaled = buf.get_i16_le()?;
27514 __struct.chan3_scaled = buf.get_i16_le()?;
27515 __struct.chan4_scaled = buf.get_i16_le()?;
27516 __struct.chan5_scaled = buf.get_i16_le()?;
27517 __struct.chan6_scaled = buf.get_i16_le()?;
27518 __struct.chan7_scaled = buf.get_i16_le()?;
27519 __struct.chan8_scaled = buf.get_i16_le()?;
27520 __struct.port = buf.get_u8()?;
27521 __struct.rssi = buf.get_u8()?;
27522 Ok(__struct)
27523 }
27524 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27525 let mut __tmp = BytesMut::new(bytes);
27526 #[allow(clippy::absurd_extreme_comparisons)]
27527 #[allow(unused_comparisons)]
27528 if __tmp.remaining() < Self::ENCODED_LEN {
27529 panic!(
27530 "buffer is too small (need {} bytes, but got {})",
27531 Self::ENCODED_LEN,
27532 __tmp.remaining(),
27533 )
27534 }
27535 __tmp.put_u32_le(self.time_boot_ms);
27536 __tmp.put_i16_le(self.chan1_scaled);
27537 __tmp.put_i16_le(self.chan2_scaled);
27538 __tmp.put_i16_le(self.chan3_scaled);
27539 __tmp.put_i16_le(self.chan4_scaled);
27540 __tmp.put_i16_le(self.chan5_scaled);
27541 __tmp.put_i16_le(self.chan6_scaled);
27542 __tmp.put_i16_le(self.chan7_scaled);
27543 __tmp.put_i16_le(self.chan8_scaled);
27544 __tmp.put_u8(self.port);
27545 __tmp.put_u8(self.rssi);
27546 if matches!(version, MavlinkVersion::V2) {
27547 let len = __tmp.len();
27548 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27549 } else {
27550 __tmp.len()
27551 }
27552 }
27553}
27554#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
27555#[doc = "Request a data stream."]
27556#[doc = ""]
27557#[doc = "ID: 66"]
27558#[derive(Debug, Clone, PartialEq)]
27559#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27561#[cfg_attr(feature = "ts", derive(TS))]
27562#[cfg_attr(feature = "ts", ts(export))]
27563pub struct REQUEST_DATA_STREAM_DATA {
27564 #[doc = "The requested message rate"]
27565 pub req_message_rate: u16,
27566 #[doc = "The target requested to send the message stream."]
27567 pub target_system: u8,
27568 #[doc = "The target requested to send the message stream."]
27569 pub target_component: u8,
27570 #[doc = "The ID of the requested data stream"]
27571 pub req_stream_id: u8,
27572 #[doc = "1 to start sending, 0 to stop sending."]
27573 pub start_stop: u8,
27574}
27575impl REQUEST_DATA_STREAM_DATA {
27576 pub const ENCODED_LEN: usize = 6usize;
27577 pub const DEFAULT: Self = Self {
27578 req_message_rate: 0_u16,
27579 target_system: 0_u8,
27580 target_component: 0_u8,
27581 req_stream_id: 0_u8,
27582 start_stop: 0_u8,
27583 };
27584 #[cfg(feature = "arbitrary")]
27585 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27586 use arbitrary::{Arbitrary, Unstructured};
27587 let mut buf = [0u8; 1024];
27588 rng.fill_bytes(&mut buf);
27589 let mut unstructured = Unstructured::new(&buf);
27590 Self::arbitrary(&mut unstructured).unwrap_or_default()
27591 }
27592}
27593impl Default for REQUEST_DATA_STREAM_DATA {
27594 fn default() -> Self {
27595 Self::DEFAULT.clone()
27596 }
27597}
27598impl MessageData for REQUEST_DATA_STREAM_DATA {
27599 type Message = MavMessage;
27600 const ID: u32 = 66u32;
27601 const NAME: &'static str = "REQUEST_DATA_STREAM";
27602 const EXTRA_CRC: u8 = 148u8;
27603 const ENCODED_LEN: usize = 6usize;
27604 fn deser(
27605 _version: MavlinkVersion,
27606 __input: &[u8],
27607 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27608 let avail_len = __input.len();
27609 let mut payload_buf = [0; Self::ENCODED_LEN];
27610 let mut buf = if avail_len < Self::ENCODED_LEN {
27611 payload_buf[0..avail_len].copy_from_slice(__input);
27612 Bytes::new(&payload_buf)
27613 } else {
27614 Bytes::new(__input)
27615 };
27616 let mut __struct = Self::default();
27617 __struct.req_message_rate = buf.get_u16_le()?;
27618 __struct.target_system = buf.get_u8()?;
27619 __struct.target_component = buf.get_u8()?;
27620 __struct.req_stream_id = buf.get_u8()?;
27621 __struct.start_stop = buf.get_u8()?;
27622 Ok(__struct)
27623 }
27624 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27625 let mut __tmp = BytesMut::new(bytes);
27626 #[allow(clippy::absurd_extreme_comparisons)]
27627 #[allow(unused_comparisons)]
27628 if __tmp.remaining() < Self::ENCODED_LEN {
27629 panic!(
27630 "buffer is too small (need {} bytes, but got {})",
27631 Self::ENCODED_LEN,
27632 __tmp.remaining(),
27633 )
27634 }
27635 __tmp.put_u16_le(self.req_message_rate);
27636 __tmp.put_u8(self.target_system);
27637 __tmp.put_u8(self.target_component);
27638 __tmp.put_u8(self.req_stream_id);
27639 __tmp.put_u8(self.start_stop);
27640 if matches!(version, MavlinkVersion::V2) {
27641 let len = __tmp.len();
27642 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27643 } else {
27644 __tmp.len()
27645 }
27646 }
27647}
27648#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
27649#[doc = ""]
27650#[doc = "ID: 412"]
27651#[derive(Debug, Clone, PartialEq)]
27652#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27653#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27654#[cfg_attr(feature = "ts", derive(TS))]
27655#[cfg_attr(feature = "ts", ts(export))]
27656pub struct REQUEST_EVENT_DATA {
27657 #[doc = "First sequence number of the requested event."]
27658 pub first_sequence: u16,
27659 #[doc = "Last sequence number of the requested event."]
27660 pub last_sequence: u16,
27661 #[doc = "System ID"]
27662 pub target_system: u8,
27663 #[doc = "Component ID"]
27664 pub target_component: u8,
27665}
27666impl REQUEST_EVENT_DATA {
27667 pub const ENCODED_LEN: usize = 6usize;
27668 pub const DEFAULT: Self = Self {
27669 first_sequence: 0_u16,
27670 last_sequence: 0_u16,
27671 target_system: 0_u8,
27672 target_component: 0_u8,
27673 };
27674 #[cfg(feature = "arbitrary")]
27675 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27676 use arbitrary::{Arbitrary, Unstructured};
27677 let mut buf = [0u8; 1024];
27678 rng.fill_bytes(&mut buf);
27679 let mut unstructured = Unstructured::new(&buf);
27680 Self::arbitrary(&mut unstructured).unwrap_or_default()
27681 }
27682}
27683impl Default for REQUEST_EVENT_DATA {
27684 fn default() -> Self {
27685 Self::DEFAULT.clone()
27686 }
27687}
27688impl MessageData for REQUEST_EVENT_DATA {
27689 type Message = MavMessage;
27690 const ID: u32 = 412u32;
27691 const NAME: &'static str = "REQUEST_EVENT";
27692 const EXTRA_CRC: u8 = 33u8;
27693 const ENCODED_LEN: usize = 6usize;
27694 fn deser(
27695 _version: MavlinkVersion,
27696 __input: &[u8],
27697 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27698 let avail_len = __input.len();
27699 let mut payload_buf = [0; Self::ENCODED_LEN];
27700 let mut buf = if avail_len < Self::ENCODED_LEN {
27701 payload_buf[0..avail_len].copy_from_slice(__input);
27702 Bytes::new(&payload_buf)
27703 } else {
27704 Bytes::new(__input)
27705 };
27706 let mut __struct = Self::default();
27707 __struct.first_sequence = buf.get_u16_le()?;
27708 __struct.last_sequence = buf.get_u16_le()?;
27709 __struct.target_system = buf.get_u8()?;
27710 __struct.target_component = buf.get_u8()?;
27711 Ok(__struct)
27712 }
27713 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27714 let mut __tmp = BytesMut::new(bytes);
27715 #[allow(clippy::absurd_extreme_comparisons)]
27716 #[allow(unused_comparisons)]
27717 if __tmp.remaining() < Self::ENCODED_LEN {
27718 panic!(
27719 "buffer is too small (need {} bytes, but got {})",
27720 Self::ENCODED_LEN,
27721 __tmp.remaining(),
27722 )
27723 }
27724 __tmp.put_u16_le(self.first_sequence);
27725 __tmp.put_u16_le(self.last_sequence);
27726 __tmp.put_u8(self.target_system);
27727 __tmp.put_u8(self.target_component);
27728 if matches!(version, MavlinkVersion::V2) {
27729 let len = __tmp.len();
27730 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27731 } else {
27732 __tmp.len()
27733 }
27734 }
27735}
27736#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
27737#[doc = ""]
27738#[doc = "ID: 142"]
27739#[derive(Debug, Clone, PartialEq)]
27740#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27741#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27742#[cfg_attr(feature = "ts", derive(TS))]
27743#[cfg_attr(feature = "ts", ts(export))]
27744pub struct RESOURCE_REQUEST_DATA {
27745 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
27746 pub request_id: u8,
27747 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
27748 pub uri_type: u8,
27749 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
27750 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27751 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27752 pub uri: [u8; 120],
27753 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
27754 pub transfer_type: u8,
27755 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
27756 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27757 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27758 pub storage: [u8; 120],
27759}
27760impl RESOURCE_REQUEST_DATA {
27761 pub const ENCODED_LEN: usize = 243usize;
27762 pub const DEFAULT: Self = Self {
27763 request_id: 0_u8,
27764 uri_type: 0_u8,
27765 uri: [0_u8; 120usize],
27766 transfer_type: 0_u8,
27767 storage: [0_u8; 120usize],
27768 };
27769 #[cfg(feature = "arbitrary")]
27770 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27771 use arbitrary::{Arbitrary, Unstructured};
27772 let mut buf = [0u8; 1024];
27773 rng.fill_bytes(&mut buf);
27774 let mut unstructured = Unstructured::new(&buf);
27775 Self::arbitrary(&mut unstructured).unwrap_or_default()
27776 }
27777}
27778impl Default for RESOURCE_REQUEST_DATA {
27779 fn default() -> Self {
27780 Self::DEFAULT.clone()
27781 }
27782}
27783impl MessageData for RESOURCE_REQUEST_DATA {
27784 type Message = MavMessage;
27785 const ID: u32 = 142u32;
27786 const NAME: &'static str = "RESOURCE_REQUEST";
27787 const EXTRA_CRC: u8 = 72u8;
27788 const ENCODED_LEN: usize = 243usize;
27789 fn deser(
27790 _version: MavlinkVersion,
27791 __input: &[u8],
27792 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27793 let avail_len = __input.len();
27794 let mut payload_buf = [0; Self::ENCODED_LEN];
27795 let mut buf = if avail_len < Self::ENCODED_LEN {
27796 payload_buf[0..avail_len].copy_from_slice(__input);
27797 Bytes::new(&payload_buf)
27798 } else {
27799 Bytes::new(__input)
27800 };
27801 let mut __struct = Self::default();
27802 __struct.request_id = buf.get_u8()?;
27803 __struct.uri_type = buf.get_u8()?;
27804 for v in &mut __struct.uri {
27805 let val = buf.get_u8()?;
27806 *v = val;
27807 }
27808 __struct.transfer_type = buf.get_u8()?;
27809 for v in &mut __struct.storage {
27810 let val = buf.get_u8()?;
27811 *v = val;
27812 }
27813 Ok(__struct)
27814 }
27815 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27816 let mut __tmp = BytesMut::new(bytes);
27817 #[allow(clippy::absurd_extreme_comparisons)]
27818 #[allow(unused_comparisons)]
27819 if __tmp.remaining() < Self::ENCODED_LEN {
27820 panic!(
27821 "buffer is too small (need {} bytes, but got {})",
27822 Self::ENCODED_LEN,
27823 __tmp.remaining(),
27824 )
27825 }
27826 __tmp.put_u8(self.request_id);
27827 __tmp.put_u8(self.uri_type);
27828 for val in &self.uri {
27829 __tmp.put_u8(*val);
27830 }
27831 __tmp.put_u8(self.transfer_type);
27832 for val in &self.storage {
27833 __tmp.put_u8(*val);
27834 }
27835 if matches!(version, MavlinkVersion::V2) {
27836 let len = __tmp.len();
27837 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27838 } else {
27839 __tmp.len()
27840 }
27841 }
27842}
27843#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
27844#[doc = ""]
27845#[doc = "ID: 413"]
27846#[derive(Debug, Clone, PartialEq)]
27847#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27849#[cfg_attr(feature = "ts", derive(TS))]
27850#[cfg_attr(feature = "ts", ts(export))]
27851pub struct RESPONSE_EVENT_ERROR_DATA {
27852 #[doc = "Sequence number."]
27853 pub sequence: u16,
27854 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
27855 pub sequence_oldest_available: u16,
27856 #[doc = "System ID"]
27857 pub target_system: u8,
27858 #[doc = "Component ID"]
27859 pub target_component: u8,
27860 #[doc = "Error reason."]
27861 pub reason: MavEventErrorReason,
27862}
27863impl RESPONSE_EVENT_ERROR_DATA {
27864 pub const ENCODED_LEN: usize = 7usize;
27865 pub const DEFAULT: Self = Self {
27866 sequence: 0_u16,
27867 sequence_oldest_available: 0_u16,
27868 target_system: 0_u8,
27869 target_component: 0_u8,
27870 reason: MavEventErrorReason::DEFAULT,
27871 };
27872 #[cfg(feature = "arbitrary")]
27873 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27874 use arbitrary::{Arbitrary, Unstructured};
27875 let mut buf = [0u8; 1024];
27876 rng.fill_bytes(&mut buf);
27877 let mut unstructured = Unstructured::new(&buf);
27878 Self::arbitrary(&mut unstructured).unwrap_or_default()
27879 }
27880}
27881impl Default for RESPONSE_EVENT_ERROR_DATA {
27882 fn default() -> Self {
27883 Self::DEFAULT.clone()
27884 }
27885}
27886impl MessageData for RESPONSE_EVENT_ERROR_DATA {
27887 type Message = MavMessage;
27888 const ID: u32 = 413u32;
27889 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
27890 const EXTRA_CRC: u8 = 77u8;
27891 const ENCODED_LEN: usize = 7usize;
27892 fn deser(
27893 _version: MavlinkVersion,
27894 __input: &[u8],
27895 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27896 let avail_len = __input.len();
27897 let mut payload_buf = [0; Self::ENCODED_LEN];
27898 let mut buf = if avail_len < Self::ENCODED_LEN {
27899 payload_buf[0..avail_len].copy_from_slice(__input);
27900 Bytes::new(&payload_buf)
27901 } else {
27902 Bytes::new(__input)
27903 };
27904 let mut __struct = Self::default();
27905 __struct.sequence = buf.get_u16_le()?;
27906 __struct.sequence_oldest_available = buf.get_u16_le()?;
27907 __struct.target_system = buf.get_u8()?;
27908 __struct.target_component = buf.get_u8()?;
27909 let tmp = buf.get_u8()?;
27910 __struct.reason =
27911 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27912 enum_type: "MavEventErrorReason",
27913 value: tmp as u64,
27914 })?;
27915 Ok(__struct)
27916 }
27917 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27918 let mut __tmp = BytesMut::new(bytes);
27919 #[allow(clippy::absurd_extreme_comparisons)]
27920 #[allow(unused_comparisons)]
27921 if __tmp.remaining() < Self::ENCODED_LEN {
27922 panic!(
27923 "buffer is too small (need {} bytes, but got {})",
27924 Self::ENCODED_LEN,
27925 __tmp.remaining(),
27926 )
27927 }
27928 __tmp.put_u16_le(self.sequence);
27929 __tmp.put_u16_le(self.sequence_oldest_available);
27930 __tmp.put_u8(self.target_system);
27931 __tmp.put_u8(self.target_component);
27932 __tmp.put_u8(self.reason as u8);
27933 if matches!(version, MavlinkVersion::V2) {
27934 let len = __tmp.len();
27935 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27936 } else {
27937 __tmp.len()
27938 }
27939 }
27940}
27941#[doc = "Read out the safety zone the MAV currently assumes."]
27942#[doc = ""]
27943#[doc = "ID: 55"]
27944#[derive(Debug, Clone, PartialEq)]
27945#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27946#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27947#[cfg_attr(feature = "ts", derive(TS))]
27948#[cfg_attr(feature = "ts", ts(export))]
27949pub struct SAFETY_ALLOWED_AREA_DATA {
27950 #[doc = "x position 1 / Latitude 1"]
27951 pub p1x: f32,
27952 #[doc = "y position 1 / Longitude 1"]
27953 pub p1y: f32,
27954 #[doc = "z position 1 / Altitude 1"]
27955 pub p1z: f32,
27956 #[doc = "x position 2 / Latitude 2"]
27957 pub p2x: f32,
27958 #[doc = "y position 2 / Longitude 2"]
27959 pub p2y: f32,
27960 #[doc = "z position 2 / Altitude 2"]
27961 pub p2z: f32,
27962 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
27963 pub frame: MavFrame,
27964}
27965impl SAFETY_ALLOWED_AREA_DATA {
27966 pub const ENCODED_LEN: usize = 25usize;
27967 pub const DEFAULT: Self = Self {
27968 p1x: 0.0_f32,
27969 p1y: 0.0_f32,
27970 p1z: 0.0_f32,
27971 p2x: 0.0_f32,
27972 p2y: 0.0_f32,
27973 p2z: 0.0_f32,
27974 frame: MavFrame::DEFAULT,
27975 };
27976 #[cfg(feature = "arbitrary")]
27977 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27978 use arbitrary::{Arbitrary, Unstructured};
27979 let mut buf = [0u8; 1024];
27980 rng.fill_bytes(&mut buf);
27981 let mut unstructured = Unstructured::new(&buf);
27982 Self::arbitrary(&mut unstructured).unwrap_or_default()
27983 }
27984}
27985impl Default for SAFETY_ALLOWED_AREA_DATA {
27986 fn default() -> Self {
27987 Self::DEFAULT.clone()
27988 }
27989}
27990impl MessageData for SAFETY_ALLOWED_AREA_DATA {
27991 type Message = MavMessage;
27992 const ID: u32 = 55u32;
27993 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
27994 const EXTRA_CRC: u8 = 3u8;
27995 const ENCODED_LEN: usize = 25usize;
27996 fn deser(
27997 _version: MavlinkVersion,
27998 __input: &[u8],
27999 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28000 let avail_len = __input.len();
28001 let mut payload_buf = [0; Self::ENCODED_LEN];
28002 let mut buf = if avail_len < Self::ENCODED_LEN {
28003 payload_buf[0..avail_len].copy_from_slice(__input);
28004 Bytes::new(&payload_buf)
28005 } else {
28006 Bytes::new(__input)
28007 };
28008 let mut __struct = Self::default();
28009 __struct.p1x = buf.get_f32_le()?;
28010 __struct.p1y = buf.get_f32_le()?;
28011 __struct.p1z = buf.get_f32_le()?;
28012 __struct.p2x = buf.get_f32_le()?;
28013 __struct.p2y = buf.get_f32_le()?;
28014 __struct.p2z = buf.get_f32_le()?;
28015 let tmp = buf.get_u8()?;
28016 __struct.frame =
28017 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28018 enum_type: "MavFrame",
28019 value: tmp as u64,
28020 })?;
28021 Ok(__struct)
28022 }
28023 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28024 let mut __tmp = BytesMut::new(bytes);
28025 #[allow(clippy::absurd_extreme_comparisons)]
28026 #[allow(unused_comparisons)]
28027 if __tmp.remaining() < Self::ENCODED_LEN {
28028 panic!(
28029 "buffer is too small (need {} bytes, but got {})",
28030 Self::ENCODED_LEN,
28031 __tmp.remaining(),
28032 )
28033 }
28034 __tmp.put_f32_le(self.p1x);
28035 __tmp.put_f32_le(self.p1y);
28036 __tmp.put_f32_le(self.p1z);
28037 __tmp.put_f32_le(self.p2x);
28038 __tmp.put_f32_le(self.p2y);
28039 __tmp.put_f32_le(self.p2z);
28040 __tmp.put_u8(self.frame as u8);
28041 if matches!(version, MavlinkVersion::V2) {
28042 let len = __tmp.len();
28043 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28044 } else {
28045 __tmp.len()
28046 }
28047 }
28048}
28049#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
28050#[doc = ""]
28051#[doc = "ID: 54"]
28052#[derive(Debug, Clone, PartialEq)]
28053#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28054#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28055#[cfg_attr(feature = "ts", derive(TS))]
28056#[cfg_attr(feature = "ts", ts(export))]
28057pub struct SAFETY_SET_ALLOWED_AREA_DATA {
28058 #[doc = "x position 1 / Latitude 1"]
28059 pub p1x: f32,
28060 #[doc = "y position 1 / Longitude 1"]
28061 pub p1y: f32,
28062 #[doc = "z position 1 / Altitude 1"]
28063 pub p1z: f32,
28064 #[doc = "x position 2 / Latitude 2"]
28065 pub p2x: f32,
28066 #[doc = "y position 2 / Longitude 2"]
28067 pub p2y: f32,
28068 #[doc = "z position 2 / Altitude 2"]
28069 pub p2z: f32,
28070 #[doc = "System ID"]
28071 pub target_system: u8,
28072 #[doc = "Component ID"]
28073 pub target_component: u8,
28074 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
28075 pub frame: MavFrame,
28076}
28077impl SAFETY_SET_ALLOWED_AREA_DATA {
28078 pub const ENCODED_LEN: usize = 27usize;
28079 pub const DEFAULT: Self = Self {
28080 p1x: 0.0_f32,
28081 p1y: 0.0_f32,
28082 p1z: 0.0_f32,
28083 p2x: 0.0_f32,
28084 p2y: 0.0_f32,
28085 p2z: 0.0_f32,
28086 target_system: 0_u8,
28087 target_component: 0_u8,
28088 frame: MavFrame::DEFAULT,
28089 };
28090 #[cfg(feature = "arbitrary")]
28091 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28092 use arbitrary::{Arbitrary, Unstructured};
28093 let mut buf = [0u8; 1024];
28094 rng.fill_bytes(&mut buf);
28095 let mut unstructured = Unstructured::new(&buf);
28096 Self::arbitrary(&mut unstructured).unwrap_or_default()
28097 }
28098}
28099impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
28100 fn default() -> Self {
28101 Self::DEFAULT.clone()
28102 }
28103}
28104impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
28105 type Message = MavMessage;
28106 const ID: u32 = 54u32;
28107 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
28108 const EXTRA_CRC: u8 = 15u8;
28109 const ENCODED_LEN: usize = 27usize;
28110 fn deser(
28111 _version: MavlinkVersion,
28112 __input: &[u8],
28113 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28114 let avail_len = __input.len();
28115 let mut payload_buf = [0; Self::ENCODED_LEN];
28116 let mut buf = if avail_len < Self::ENCODED_LEN {
28117 payload_buf[0..avail_len].copy_from_slice(__input);
28118 Bytes::new(&payload_buf)
28119 } else {
28120 Bytes::new(__input)
28121 };
28122 let mut __struct = Self::default();
28123 __struct.p1x = buf.get_f32_le()?;
28124 __struct.p1y = buf.get_f32_le()?;
28125 __struct.p1z = buf.get_f32_le()?;
28126 __struct.p2x = buf.get_f32_le()?;
28127 __struct.p2y = buf.get_f32_le()?;
28128 __struct.p2z = buf.get_f32_le()?;
28129 __struct.target_system = buf.get_u8()?;
28130 __struct.target_component = buf.get_u8()?;
28131 let tmp = buf.get_u8()?;
28132 __struct.frame =
28133 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28134 enum_type: "MavFrame",
28135 value: tmp as u64,
28136 })?;
28137 Ok(__struct)
28138 }
28139 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28140 let mut __tmp = BytesMut::new(bytes);
28141 #[allow(clippy::absurd_extreme_comparisons)]
28142 #[allow(unused_comparisons)]
28143 if __tmp.remaining() < Self::ENCODED_LEN {
28144 panic!(
28145 "buffer is too small (need {} bytes, but got {})",
28146 Self::ENCODED_LEN,
28147 __tmp.remaining(),
28148 )
28149 }
28150 __tmp.put_f32_le(self.p1x);
28151 __tmp.put_f32_le(self.p1y);
28152 __tmp.put_f32_le(self.p1z);
28153 __tmp.put_f32_le(self.p2x);
28154 __tmp.put_f32_le(self.p2y);
28155 __tmp.put_f32_le(self.p2z);
28156 __tmp.put_u8(self.target_system);
28157 __tmp.put_u8(self.target_component);
28158 __tmp.put_u8(self.frame as u8);
28159 if matches!(version, MavlinkVersion::V2) {
28160 let len = __tmp.len();
28161 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28162 } else {
28163 __tmp.len()
28164 }
28165 }
28166}
28167#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
28168#[doc = ""]
28169#[doc = "ID: 26"]
28170#[derive(Debug, Clone, PartialEq)]
28171#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28172#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28173#[cfg_attr(feature = "ts", derive(TS))]
28174#[cfg_attr(feature = "ts", ts(export))]
28175pub struct SCALED_IMU_DATA {
28176 #[doc = "Timestamp (time since system boot)."]
28177 pub time_boot_ms: u32,
28178 #[doc = "X acceleration"]
28179 pub xacc: i16,
28180 #[doc = "Y acceleration"]
28181 pub yacc: i16,
28182 #[doc = "Z acceleration"]
28183 pub zacc: i16,
28184 #[doc = "Angular speed around X axis"]
28185 pub xgyro: i16,
28186 #[doc = "Angular speed around Y axis"]
28187 pub ygyro: i16,
28188 #[doc = "Angular speed around Z axis"]
28189 pub zgyro: i16,
28190 #[doc = "X Magnetic field"]
28191 pub xmag: i16,
28192 #[doc = "Y Magnetic field"]
28193 pub ymag: i16,
28194 #[doc = "Z Magnetic field"]
28195 pub zmag: i16,
28196 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
28197 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28198 pub temperature: i16,
28199}
28200impl SCALED_IMU_DATA {
28201 pub const ENCODED_LEN: usize = 24usize;
28202 pub const DEFAULT: Self = Self {
28203 time_boot_ms: 0_u32,
28204 xacc: 0_i16,
28205 yacc: 0_i16,
28206 zacc: 0_i16,
28207 xgyro: 0_i16,
28208 ygyro: 0_i16,
28209 zgyro: 0_i16,
28210 xmag: 0_i16,
28211 ymag: 0_i16,
28212 zmag: 0_i16,
28213 temperature: 0_i16,
28214 };
28215 #[cfg(feature = "arbitrary")]
28216 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28217 use arbitrary::{Arbitrary, Unstructured};
28218 let mut buf = [0u8; 1024];
28219 rng.fill_bytes(&mut buf);
28220 let mut unstructured = Unstructured::new(&buf);
28221 Self::arbitrary(&mut unstructured).unwrap_or_default()
28222 }
28223}
28224impl Default for SCALED_IMU_DATA {
28225 fn default() -> Self {
28226 Self::DEFAULT.clone()
28227 }
28228}
28229impl MessageData for SCALED_IMU_DATA {
28230 type Message = MavMessage;
28231 const ID: u32 = 26u32;
28232 const NAME: &'static str = "SCALED_IMU";
28233 const EXTRA_CRC: u8 = 170u8;
28234 const ENCODED_LEN: usize = 24usize;
28235 fn deser(
28236 _version: MavlinkVersion,
28237 __input: &[u8],
28238 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28239 let avail_len = __input.len();
28240 let mut payload_buf = [0; Self::ENCODED_LEN];
28241 let mut buf = if avail_len < Self::ENCODED_LEN {
28242 payload_buf[0..avail_len].copy_from_slice(__input);
28243 Bytes::new(&payload_buf)
28244 } else {
28245 Bytes::new(__input)
28246 };
28247 let mut __struct = Self::default();
28248 __struct.time_boot_ms = buf.get_u32_le()?;
28249 __struct.xacc = buf.get_i16_le()?;
28250 __struct.yacc = buf.get_i16_le()?;
28251 __struct.zacc = buf.get_i16_le()?;
28252 __struct.xgyro = buf.get_i16_le()?;
28253 __struct.ygyro = buf.get_i16_le()?;
28254 __struct.zgyro = buf.get_i16_le()?;
28255 __struct.xmag = buf.get_i16_le()?;
28256 __struct.ymag = buf.get_i16_le()?;
28257 __struct.zmag = buf.get_i16_le()?;
28258 __struct.temperature = buf.get_i16_le()?;
28259 Ok(__struct)
28260 }
28261 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28262 let mut __tmp = BytesMut::new(bytes);
28263 #[allow(clippy::absurd_extreme_comparisons)]
28264 #[allow(unused_comparisons)]
28265 if __tmp.remaining() < Self::ENCODED_LEN {
28266 panic!(
28267 "buffer is too small (need {} bytes, but got {})",
28268 Self::ENCODED_LEN,
28269 __tmp.remaining(),
28270 )
28271 }
28272 __tmp.put_u32_le(self.time_boot_ms);
28273 __tmp.put_i16_le(self.xacc);
28274 __tmp.put_i16_le(self.yacc);
28275 __tmp.put_i16_le(self.zacc);
28276 __tmp.put_i16_le(self.xgyro);
28277 __tmp.put_i16_le(self.ygyro);
28278 __tmp.put_i16_le(self.zgyro);
28279 __tmp.put_i16_le(self.xmag);
28280 __tmp.put_i16_le(self.ymag);
28281 __tmp.put_i16_le(self.zmag);
28282 if matches!(version, MavlinkVersion::V2) {
28283 __tmp.put_i16_le(self.temperature);
28284 let len = __tmp.len();
28285 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28286 } else {
28287 __tmp.len()
28288 }
28289 }
28290}
28291#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
28292#[doc = ""]
28293#[doc = "ID: 116"]
28294#[derive(Debug, Clone, PartialEq)]
28295#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28296#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28297#[cfg_attr(feature = "ts", derive(TS))]
28298#[cfg_attr(feature = "ts", ts(export))]
28299pub struct SCALED_IMU2_DATA {
28300 #[doc = "Timestamp (time since system boot)."]
28301 pub time_boot_ms: u32,
28302 #[doc = "X acceleration"]
28303 pub xacc: i16,
28304 #[doc = "Y acceleration"]
28305 pub yacc: i16,
28306 #[doc = "Z acceleration"]
28307 pub zacc: i16,
28308 #[doc = "Angular speed around X axis"]
28309 pub xgyro: i16,
28310 #[doc = "Angular speed around Y axis"]
28311 pub ygyro: i16,
28312 #[doc = "Angular speed around Z axis"]
28313 pub zgyro: i16,
28314 #[doc = "X Magnetic field"]
28315 pub xmag: i16,
28316 #[doc = "Y Magnetic field"]
28317 pub ymag: i16,
28318 #[doc = "Z Magnetic field"]
28319 pub zmag: i16,
28320 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
28321 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28322 pub temperature: i16,
28323}
28324impl SCALED_IMU2_DATA {
28325 pub const ENCODED_LEN: usize = 24usize;
28326 pub const DEFAULT: Self = Self {
28327 time_boot_ms: 0_u32,
28328 xacc: 0_i16,
28329 yacc: 0_i16,
28330 zacc: 0_i16,
28331 xgyro: 0_i16,
28332 ygyro: 0_i16,
28333 zgyro: 0_i16,
28334 xmag: 0_i16,
28335 ymag: 0_i16,
28336 zmag: 0_i16,
28337 temperature: 0_i16,
28338 };
28339 #[cfg(feature = "arbitrary")]
28340 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28341 use arbitrary::{Arbitrary, Unstructured};
28342 let mut buf = [0u8; 1024];
28343 rng.fill_bytes(&mut buf);
28344 let mut unstructured = Unstructured::new(&buf);
28345 Self::arbitrary(&mut unstructured).unwrap_or_default()
28346 }
28347}
28348impl Default for SCALED_IMU2_DATA {
28349 fn default() -> Self {
28350 Self::DEFAULT.clone()
28351 }
28352}
28353impl MessageData for SCALED_IMU2_DATA {
28354 type Message = MavMessage;
28355 const ID: u32 = 116u32;
28356 const NAME: &'static str = "SCALED_IMU2";
28357 const EXTRA_CRC: u8 = 76u8;
28358 const ENCODED_LEN: usize = 24usize;
28359 fn deser(
28360 _version: MavlinkVersion,
28361 __input: &[u8],
28362 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28363 let avail_len = __input.len();
28364 let mut payload_buf = [0; Self::ENCODED_LEN];
28365 let mut buf = if avail_len < Self::ENCODED_LEN {
28366 payload_buf[0..avail_len].copy_from_slice(__input);
28367 Bytes::new(&payload_buf)
28368 } else {
28369 Bytes::new(__input)
28370 };
28371 let mut __struct = Self::default();
28372 __struct.time_boot_ms = buf.get_u32_le()?;
28373 __struct.xacc = buf.get_i16_le()?;
28374 __struct.yacc = buf.get_i16_le()?;
28375 __struct.zacc = buf.get_i16_le()?;
28376 __struct.xgyro = buf.get_i16_le()?;
28377 __struct.ygyro = buf.get_i16_le()?;
28378 __struct.zgyro = buf.get_i16_le()?;
28379 __struct.xmag = buf.get_i16_le()?;
28380 __struct.ymag = buf.get_i16_le()?;
28381 __struct.zmag = buf.get_i16_le()?;
28382 __struct.temperature = buf.get_i16_le()?;
28383 Ok(__struct)
28384 }
28385 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28386 let mut __tmp = BytesMut::new(bytes);
28387 #[allow(clippy::absurd_extreme_comparisons)]
28388 #[allow(unused_comparisons)]
28389 if __tmp.remaining() < Self::ENCODED_LEN {
28390 panic!(
28391 "buffer is too small (need {} bytes, but got {})",
28392 Self::ENCODED_LEN,
28393 __tmp.remaining(),
28394 )
28395 }
28396 __tmp.put_u32_le(self.time_boot_ms);
28397 __tmp.put_i16_le(self.xacc);
28398 __tmp.put_i16_le(self.yacc);
28399 __tmp.put_i16_le(self.zacc);
28400 __tmp.put_i16_le(self.xgyro);
28401 __tmp.put_i16_le(self.ygyro);
28402 __tmp.put_i16_le(self.zgyro);
28403 __tmp.put_i16_le(self.xmag);
28404 __tmp.put_i16_le(self.ymag);
28405 __tmp.put_i16_le(self.zmag);
28406 if matches!(version, MavlinkVersion::V2) {
28407 __tmp.put_i16_le(self.temperature);
28408 let len = __tmp.len();
28409 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28410 } else {
28411 __tmp.len()
28412 }
28413 }
28414}
28415#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
28416#[doc = ""]
28417#[doc = "ID: 129"]
28418#[derive(Debug, Clone, PartialEq)]
28419#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28420#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28421#[cfg_attr(feature = "ts", derive(TS))]
28422#[cfg_attr(feature = "ts", ts(export))]
28423pub struct SCALED_IMU3_DATA {
28424 #[doc = "Timestamp (time since system boot)."]
28425 pub time_boot_ms: u32,
28426 #[doc = "X acceleration"]
28427 pub xacc: i16,
28428 #[doc = "Y acceleration"]
28429 pub yacc: i16,
28430 #[doc = "Z acceleration"]
28431 pub zacc: i16,
28432 #[doc = "Angular speed around X axis"]
28433 pub xgyro: i16,
28434 #[doc = "Angular speed around Y axis"]
28435 pub ygyro: i16,
28436 #[doc = "Angular speed around Z axis"]
28437 pub zgyro: i16,
28438 #[doc = "X Magnetic field"]
28439 pub xmag: i16,
28440 #[doc = "Y Magnetic field"]
28441 pub ymag: i16,
28442 #[doc = "Z Magnetic field"]
28443 pub zmag: i16,
28444 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
28445 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28446 pub temperature: i16,
28447}
28448impl SCALED_IMU3_DATA {
28449 pub const ENCODED_LEN: usize = 24usize;
28450 pub const DEFAULT: Self = Self {
28451 time_boot_ms: 0_u32,
28452 xacc: 0_i16,
28453 yacc: 0_i16,
28454 zacc: 0_i16,
28455 xgyro: 0_i16,
28456 ygyro: 0_i16,
28457 zgyro: 0_i16,
28458 xmag: 0_i16,
28459 ymag: 0_i16,
28460 zmag: 0_i16,
28461 temperature: 0_i16,
28462 };
28463 #[cfg(feature = "arbitrary")]
28464 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28465 use arbitrary::{Arbitrary, Unstructured};
28466 let mut buf = [0u8; 1024];
28467 rng.fill_bytes(&mut buf);
28468 let mut unstructured = Unstructured::new(&buf);
28469 Self::arbitrary(&mut unstructured).unwrap_or_default()
28470 }
28471}
28472impl Default for SCALED_IMU3_DATA {
28473 fn default() -> Self {
28474 Self::DEFAULT.clone()
28475 }
28476}
28477impl MessageData for SCALED_IMU3_DATA {
28478 type Message = MavMessage;
28479 const ID: u32 = 129u32;
28480 const NAME: &'static str = "SCALED_IMU3";
28481 const EXTRA_CRC: u8 = 46u8;
28482 const ENCODED_LEN: usize = 24usize;
28483 fn deser(
28484 _version: MavlinkVersion,
28485 __input: &[u8],
28486 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28487 let avail_len = __input.len();
28488 let mut payload_buf = [0; Self::ENCODED_LEN];
28489 let mut buf = if avail_len < Self::ENCODED_LEN {
28490 payload_buf[0..avail_len].copy_from_slice(__input);
28491 Bytes::new(&payload_buf)
28492 } else {
28493 Bytes::new(__input)
28494 };
28495 let mut __struct = Self::default();
28496 __struct.time_boot_ms = buf.get_u32_le()?;
28497 __struct.xacc = buf.get_i16_le()?;
28498 __struct.yacc = buf.get_i16_le()?;
28499 __struct.zacc = buf.get_i16_le()?;
28500 __struct.xgyro = buf.get_i16_le()?;
28501 __struct.ygyro = buf.get_i16_le()?;
28502 __struct.zgyro = buf.get_i16_le()?;
28503 __struct.xmag = buf.get_i16_le()?;
28504 __struct.ymag = buf.get_i16_le()?;
28505 __struct.zmag = buf.get_i16_le()?;
28506 __struct.temperature = buf.get_i16_le()?;
28507 Ok(__struct)
28508 }
28509 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28510 let mut __tmp = BytesMut::new(bytes);
28511 #[allow(clippy::absurd_extreme_comparisons)]
28512 #[allow(unused_comparisons)]
28513 if __tmp.remaining() < Self::ENCODED_LEN {
28514 panic!(
28515 "buffer is too small (need {} bytes, but got {})",
28516 Self::ENCODED_LEN,
28517 __tmp.remaining(),
28518 )
28519 }
28520 __tmp.put_u32_le(self.time_boot_ms);
28521 __tmp.put_i16_le(self.xacc);
28522 __tmp.put_i16_le(self.yacc);
28523 __tmp.put_i16_le(self.zacc);
28524 __tmp.put_i16_le(self.xgyro);
28525 __tmp.put_i16_le(self.ygyro);
28526 __tmp.put_i16_le(self.zgyro);
28527 __tmp.put_i16_le(self.xmag);
28528 __tmp.put_i16_le(self.ymag);
28529 __tmp.put_i16_le(self.zmag);
28530 if matches!(version, MavlinkVersion::V2) {
28531 __tmp.put_i16_le(self.temperature);
28532 let len = __tmp.len();
28533 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28534 } else {
28535 __tmp.len()
28536 }
28537 }
28538}
28539#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
28540#[doc = ""]
28541#[doc = "ID: 29"]
28542#[derive(Debug, Clone, PartialEq)]
28543#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28544#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28545#[cfg_attr(feature = "ts", derive(TS))]
28546#[cfg_attr(feature = "ts", ts(export))]
28547pub struct SCALED_PRESSURE_DATA {
28548 #[doc = "Timestamp (time since system boot)."]
28549 pub time_boot_ms: u32,
28550 #[doc = "Absolute pressure"]
28551 pub press_abs: f32,
28552 #[doc = "Differential pressure 1"]
28553 pub press_diff: f32,
28554 #[doc = "Absolute pressure temperature"]
28555 pub temperature: i16,
28556 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
28557 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28558 pub temperature_press_diff: i16,
28559}
28560impl SCALED_PRESSURE_DATA {
28561 pub const ENCODED_LEN: usize = 16usize;
28562 pub const DEFAULT: Self = Self {
28563 time_boot_ms: 0_u32,
28564 press_abs: 0.0_f32,
28565 press_diff: 0.0_f32,
28566 temperature: 0_i16,
28567 temperature_press_diff: 0_i16,
28568 };
28569 #[cfg(feature = "arbitrary")]
28570 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28571 use arbitrary::{Arbitrary, Unstructured};
28572 let mut buf = [0u8; 1024];
28573 rng.fill_bytes(&mut buf);
28574 let mut unstructured = Unstructured::new(&buf);
28575 Self::arbitrary(&mut unstructured).unwrap_or_default()
28576 }
28577}
28578impl Default for SCALED_PRESSURE_DATA {
28579 fn default() -> Self {
28580 Self::DEFAULT.clone()
28581 }
28582}
28583impl MessageData for SCALED_PRESSURE_DATA {
28584 type Message = MavMessage;
28585 const ID: u32 = 29u32;
28586 const NAME: &'static str = "SCALED_PRESSURE";
28587 const EXTRA_CRC: u8 = 115u8;
28588 const ENCODED_LEN: usize = 16usize;
28589 fn deser(
28590 _version: MavlinkVersion,
28591 __input: &[u8],
28592 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28593 let avail_len = __input.len();
28594 let mut payload_buf = [0; Self::ENCODED_LEN];
28595 let mut buf = if avail_len < Self::ENCODED_LEN {
28596 payload_buf[0..avail_len].copy_from_slice(__input);
28597 Bytes::new(&payload_buf)
28598 } else {
28599 Bytes::new(__input)
28600 };
28601 let mut __struct = Self::default();
28602 __struct.time_boot_ms = buf.get_u32_le()?;
28603 __struct.press_abs = buf.get_f32_le()?;
28604 __struct.press_diff = buf.get_f32_le()?;
28605 __struct.temperature = buf.get_i16_le()?;
28606 __struct.temperature_press_diff = buf.get_i16_le()?;
28607 Ok(__struct)
28608 }
28609 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28610 let mut __tmp = BytesMut::new(bytes);
28611 #[allow(clippy::absurd_extreme_comparisons)]
28612 #[allow(unused_comparisons)]
28613 if __tmp.remaining() < Self::ENCODED_LEN {
28614 panic!(
28615 "buffer is too small (need {} bytes, but got {})",
28616 Self::ENCODED_LEN,
28617 __tmp.remaining(),
28618 )
28619 }
28620 __tmp.put_u32_le(self.time_boot_ms);
28621 __tmp.put_f32_le(self.press_abs);
28622 __tmp.put_f32_le(self.press_diff);
28623 __tmp.put_i16_le(self.temperature);
28624 if matches!(version, MavlinkVersion::V2) {
28625 __tmp.put_i16_le(self.temperature_press_diff);
28626 let len = __tmp.len();
28627 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28628 } else {
28629 __tmp.len()
28630 }
28631 }
28632}
28633#[doc = "Barometer readings for 2nd barometer."]
28634#[doc = ""]
28635#[doc = "ID: 137"]
28636#[derive(Debug, Clone, PartialEq)]
28637#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28638#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28639#[cfg_attr(feature = "ts", derive(TS))]
28640#[cfg_attr(feature = "ts", ts(export))]
28641pub struct SCALED_PRESSURE2_DATA {
28642 #[doc = "Timestamp (time since system boot)."]
28643 pub time_boot_ms: u32,
28644 #[doc = "Absolute pressure"]
28645 pub press_abs: f32,
28646 #[doc = "Differential pressure"]
28647 pub press_diff: f32,
28648 #[doc = "Absolute pressure temperature"]
28649 pub temperature: i16,
28650 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
28651 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28652 pub temperature_press_diff: i16,
28653}
28654impl SCALED_PRESSURE2_DATA {
28655 pub const ENCODED_LEN: usize = 16usize;
28656 pub const DEFAULT: Self = Self {
28657 time_boot_ms: 0_u32,
28658 press_abs: 0.0_f32,
28659 press_diff: 0.0_f32,
28660 temperature: 0_i16,
28661 temperature_press_diff: 0_i16,
28662 };
28663 #[cfg(feature = "arbitrary")]
28664 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28665 use arbitrary::{Arbitrary, Unstructured};
28666 let mut buf = [0u8; 1024];
28667 rng.fill_bytes(&mut buf);
28668 let mut unstructured = Unstructured::new(&buf);
28669 Self::arbitrary(&mut unstructured).unwrap_or_default()
28670 }
28671}
28672impl Default for SCALED_PRESSURE2_DATA {
28673 fn default() -> Self {
28674 Self::DEFAULT.clone()
28675 }
28676}
28677impl MessageData for SCALED_PRESSURE2_DATA {
28678 type Message = MavMessage;
28679 const ID: u32 = 137u32;
28680 const NAME: &'static str = "SCALED_PRESSURE2";
28681 const EXTRA_CRC: u8 = 195u8;
28682 const ENCODED_LEN: usize = 16usize;
28683 fn deser(
28684 _version: MavlinkVersion,
28685 __input: &[u8],
28686 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28687 let avail_len = __input.len();
28688 let mut payload_buf = [0; Self::ENCODED_LEN];
28689 let mut buf = if avail_len < Self::ENCODED_LEN {
28690 payload_buf[0..avail_len].copy_from_slice(__input);
28691 Bytes::new(&payload_buf)
28692 } else {
28693 Bytes::new(__input)
28694 };
28695 let mut __struct = Self::default();
28696 __struct.time_boot_ms = buf.get_u32_le()?;
28697 __struct.press_abs = buf.get_f32_le()?;
28698 __struct.press_diff = buf.get_f32_le()?;
28699 __struct.temperature = buf.get_i16_le()?;
28700 __struct.temperature_press_diff = buf.get_i16_le()?;
28701 Ok(__struct)
28702 }
28703 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28704 let mut __tmp = BytesMut::new(bytes);
28705 #[allow(clippy::absurd_extreme_comparisons)]
28706 #[allow(unused_comparisons)]
28707 if __tmp.remaining() < Self::ENCODED_LEN {
28708 panic!(
28709 "buffer is too small (need {} bytes, but got {})",
28710 Self::ENCODED_LEN,
28711 __tmp.remaining(),
28712 )
28713 }
28714 __tmp.put_u32_le(self.time_boot_ms);
28715 __tmp.put_f32_le(self.press_abs);
28716 __tmp.put_f32_le(self.press_diff);
28717 __tmp.put_i16_le(self.temperature);
28718 if matches!(version, MavlinkVersion::V2) {
28719 __tmp.put_i16_le(self.temperature_press_diff);
28720 let len = __tmp.len();
28721 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28722 } else {
28723 __tmp.len()
28724 }
28725 }
28726}
28727#[doc = "Barometer readings for 3rd barometer."]
28728#[doc = ""]
28729#[doc = "ID: 143"]
28730#[derive(Debug, Clone, PartialEq)]
28731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28733#[cfg_attr(feature = "ts", derive(TS))]
28734#[cfg_attr(feature = "ts", ts(export))]
28735pub struct SCALED_PRESSURE3_DATA {
28736 #[doc = "Timestamp (time since system boot)."]
28737 pub time_boot_ms: u32,
28738 #[doc = "Absolute pressure"]
28739 pub press_abs: f32,
28740 #[doc = "Differential pressure"]
28741 pub press_diff: f32,
28742 #[doc = "Absolute pressure temperature"]
28743 pub temperature: i16,
28744 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
28745 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28746 pub temperature_press_diff: i16,
28747}
28748impl SCALED_PRESSURE3_DATA {
28749 pub const ENCODED_LEN: usize = 16usize;
28750 pub const DEFAULT: Self = Self {
28751 time_boot_ms: 0_u32,
28752 press_abs: 0.0_f32,
28753 press_diff: 0.0_f32,
28754 temperature: 0_i16,
28755 temperature_press_diff: 0_i16,
28756 };
28757 #[cfg(feature = "arbitrary")]
28758 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28759 use arbitrary::{Arbitrary, Unstructured};
28760 let mut buf = [0u8; 1024];
28761 rng.fill_bytes(&mut buf);
28762 let mut unstructured = Unstructured::new(&buf);
28763 Self::arbitrary(&mut unstructured).unwrap_or_default()
28764 }
28765}
28766impl Default for SCALED_PRESSURE3_DATA {
28767 fn default() -> Self {
28768 Self::DEFAULT.clone()
28769 }
28770}
28771impl MessageData for SCALED_PRESSURE3_DATA {
28772 type Message = MavMessage;
28773 const ID: u32 = 143u32;
28774 const NAME: &'static str = "SCALED_PRESSURE3";
28775 const EXTRA_CRC: u8 = 131u8;
28776 const ENCODED_LEN: usize = 16usize;
28777 fn deser(
28778 _version: MavlinkVersion,
28779 __input: &[u8],
28780 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28781 let avail_len = __input.len();
28782 let mut payload_buf = [0; Self::ENCODED_LEN];
28783 let mut buf = if avail_len < Self::ENCODED_LEN {
28784 payload_buf[0..avail_len].copy_from_slice(__input);
28785 Bytes::new(&payload_buf)
28786 } else {
28787 Bytes::new(__input)
28788 };
28789 let mut __struct = Self::default();
28790 __struct.time_boot_ms = buf.get_u32_le()?;
28791 __struct.press_abs = buf.get_f32_le()?;
28792 __struct.press_diff = buf.get_f32_le()?;
28793 __struct.temperature = buf.get_i16_le()?;
28794 __struct.temperature_press_diff = buf.get_i16_le()?;
28795 Ok(__struct)
28796 }
28797 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28798 let mut __tmp = BytesMut::new(bytes);
28799 #[allow(clippy::absurd_extreme_comparisons)]
28800 #[allow(unused_comparisons)]
28801 if __tmp.remaining() < Self::ENCODED_LEN {
28802 panic!(
28803 "buffer is too small (need {} bytes, but got {})",
28804 Self::ENCODED_LEN,
28805 __tmp.remaining(),
28806 )
28807 }
28808 __tmp.put_u32_le(self.time_boot_ms);
28809 __tmp.put_f32_le(self.press_abs);
28810 __tmp.put_f32_le(self.press_diff);
28811 __tmp.put_i16_le(self.temperature);
28812 if matches!(version, MavlinkVersion::V2) {
28813 __tmp.put_i16_le(self.temperature_press_diff);
28814 let len = __tmp.len();
28815 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28816 } else {
28817 __tmp.len()
28818 }
28819 }
28820}
28821#[doc = "This message is emitted as response to SCRIPT_REQUEST_LIST by the MAV to get the number of mission scripts."]
28822#[doc = ""]
28823#[doc = "ID: 183"]
28824#[derive(Debug, Clone, PartialEq)]
28825#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28826#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28827#[cfg_attr(feature = "ts", derive(TS))]
28828#[cfg_attr(feature = "ts", ts(export))]
28829pub struct SCRIPT_COUNT_DATA {
28830 #[doc = "Number of script items in the sequence"]
28831 pub count: u16,
28832 #[doc = "System ID"]
28833 pub target_system: u8,
28834 #[doc = "Component ID"]
28835 pub target_component: u8,
28836}
28837impl SCRIPT_COUNT_DATA {
28838 pub const ENCODED_LEN: usize = 4usize;
28839 pub const DEFAULT: Self = Self {
28840 count: 0_u16,
28841 target_system: 0_u8,
28842 target_component: 0_u8,
28843 };
28844 #[cfg(feature = "arbitrary")]
28845 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28846 use arbitrary::{Arbitrary, Unstructured};
28847 let mut buf = [0u8; 1024];
28848 rng.fill_bytes(&mut buf);
28849 let mut unstructured = Unstructured::new(&buf);
28850 Self::arbitrary(&mut unstructured).unwrap_or_default()
28851 }
28852}
28853impl Default for SCRIPT_COUNT_DATA {
28854 fn default() -> Self {
28855 Self::DEFAULT.clone()
28856 }
28857}
28858impl MessageData for SCRIPT_COUNT_DATA {
28859 type Message = MavMessage;
28860 const ID: u32 = 183u32;
28861 const NAME: &'static str = "SCRIPT_COUNT";
28862 const EXTRA_CRC: u8 = 186u8;
28863 const ENCODED_LEN: usize = 4usize;
28864 fn deser(
28865 _version: MavlinkVersion,
28866 __input: &[u8],
28867 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28868 let avail_len = __input.len();
28869 let mut payload_buf = [0; Self::ENCODED_LEN];
28870 let mut buf = if avail_len < Self::ENCODED_LEN {
28871 payload_buf[0..avail_len].copy_from_slice(__input);
28872 Bytes::new(&payload_buf)
28873 } else {
28874 Bytes::new(__input)
28875 };
28876 let mut __struct = Self::default();
28877 __struct.count = buf.get_u16_le()?;
28878 __struct.target_system = buf.get_u8()?;
28879 __struct.target_component = buf.get_u8()?;
28880 Ok(__struct)
28881 }
28882 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28883 let mut __tmp = BytesMut::new(bytes);
28884 #[allow(clippy::absurd_extreme_comparisons)]
28885 #[allow(unused_comparisons)]
28886 if __tmp.remaining() < Self::ENCODED_LEN {
28887 panic!(
28888 "buffer is too small (need {} bytes, but got {})",
28889 Self::ENCODED_LEN,
28890 __tmp.remaining(),
28891 )
28892 }
28893 __tmp.put_u16_le(self.count);
28894 __tmp.put_u8(self.target_system);
28895 __tmp.put_u8(self.target_component);
28896 if matches!(version, MavlinkVersion::V2) {
28897 let len = __tmp.len();
28898 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28899 } else {
28900 __tmp.len()
28901 }
28902 }
28903}
28904#[doc = "This message informs about the currently active SCRIPT."]
28905#[doc = ""]
28906#[doc = "ID: 184"]
28907#[derive(Debug, Clone, PartialEq)]
28908#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28909#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28910#[cfg_attr(feature = "ts", derive(TS))]
28911#[cfg_attr(feature = "ts", ts(export))]
28912pub struct SCRIPT_CURRENT_DATA {
28913 #[doc = "Active Sequence"]
28914 pub seq: u16,
28915}
28916impl SCRIPT_CURRENT_DATA {
28917 pub const ENCODED_LEN: usize = 2usize;
28918 pub const DEFAULT: Self = Self { seq: 0_u16 };
28919 #[cfg(feature = "arbitrary")]
28920 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28921 use arbitrary::{Arbitrary, Unstructured};
28922 let mut buf = [0u8; 1024];
28923 rng.fill_bytes(&mut buf);
28924 let mut unstructured = Unstructured::new(&buf);
28925 Self::arbitrary(&mut unstructured).unwrap_or_default()
28926 }
28927}
28928impl Default for SCRIPT_CURRENT_DATA {
28929 fn default() -> Self {
28930 Self::DEFAULT.clone()
28931 }
28932}
28933impl MessageData for SCRIPT_CURRENT_DATA {
28934 type Message = MavMessage;
28935 const ID: u32 = 184u32;
28936 const NAME: &'static str = "SCRIPT_CURRENT";
28937 const EXTRA_CRC: u8 = 40u8;
28938 const ENCODED_LEN: usize = 2usize;
28939 fn deser(
28940 _version: MavlinkVersion,
28941 __input: &[u8],
28942 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28943 let avail_len = __input.len();
28944 let mut payload_buf = [0; Self::ENCODED_LEN];
28945 let mut buf = if avail_len < Self::ENCODED_LEN {
28946 payload_buf[0..avail_len].copy_from_slice(__input);
28947 Bytes::new(&payload_buf)
28948 } else {
28949 Bytes::new(__input)
28950 };
28951 let mut __struct = Self::default();
28952 __struct.seq = buf.get_u16_le()?;
28953 Ok(__struct)
28954 }
28955 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28956 let mut __tmp = BytesMut::new(bytes);
28957 #[allow(clippy::absurd_extreme_comparisons)]
28958 #[allow(unused_comparisons)]
28959 if __tmp.remaining() < Self::ENCODED_LEN {
28960 panic!(
28961 "buffer is too small (need {} bytes, but got {})",
28962 Self::ENCODED_LEN,
28963 __tmp.remaining(),
28964 )
28965 }
28966 __tmp.put_u16_le(self.seq);
28967 if matches!(version, MavlinkVersion::V2) {
28968 let len = __tmp.len();
28969 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28970 } else {
28971 __tmp.len()
28972 }
28973 }
28974}
28975#[doc = "Message encoding a mission script item. This message is emitted upon a request for the next script item."]
28976#[doc = ""]
28977#[doc = "ID: 180"]
28978#[derive(Debug, Clone, PartialEq)]
28979#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28980#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28981#[cfg_attr(feature = "ts", derive(TS))]
28982#[cfg_attr(feature = "ts", ts(export))]
28983pub struct SCRIPT_ITEM_DATA {
28984 #[doc = "Sequence"]
28985 pub seq: u16,
28986 #[doc = "System ID"]
28987 pub target_system: u8,
28988 #[doc = "Component ID"]
28989 pub target_component: u8,
28990 #[doc = "The name of the mission script, NULL terminated."]
28991 #[cfg_attr(feature = "ts", ts(type = "string"))]
28992 pub name: CharArray<50>,
28993}
28994impl SCRIPT_ITEM_DATA {
28995 pub const ENCODED_LEN: usize = 54usize;
28996 pub const DEFAULT: Self = Self {
28997 seq: 0_u16,
28998 target_system: 0_u8,
28999 target_component: 0_u8,
29000 name: CharArray::new([0_u8; 50usize]),
29001 };
29002 #[cfg(feature = "arbitrary")]
29003 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29004 use arbitrary::{Arbitrary, Unstructured};
29005 let mut buf = [0u8; 1024];
29006 rng.fill_bytes(&mut buf);
29007 let mut unstructured = Unstructured::new(&buf);
29008 Self::arbitrary(&mut unstructured).unwrap_or_default()
29009 }
29010}
29011impl Default for SCRIPT_ITEM_DATA {
29012 fn default() -> Self {
29013 Self::DEFAULT.clone()
29014 }
29015}
29016impl MessageData for SCRIPT_ITEM_DATA {
29017 type Message = MavMessage;
29018 const ID: u32 = 180u32;
29019 const NAME: &'static str = "SCRIPT_ITEM";
29020 const EXTRA_CRC: u8 = 231u8;
29021 const ENCODED_LEN: usize = 54usize;
29022 fn deser(
29023 _version: MavlinkVersion,
29024 __input: &[u8],
29025 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29026 let avail_len = __input.len();
29027 let mut payload_buf = [0; Self::ENCODED_LEN];
29028 let mut buf = if avail_len < Self::ENCODED_LEN {
29029 payload_buf[0..avail_len].copy_from_slice(__input);
29030 Bytes::new(&payload_buf)
29031 } else {
29032 Bytes::new(__input)
29033 };
29034 let mut __struct = Self::default();
29035 __struct.seq = buf.get_u16_le()?;
29036 __struct.target_system = buf.get_u8()?;
29037 __struct.target_component = buf.get_u8()?;
29038 let mut tmp = [0_u8; 50usize];
29039 for v in &mut tmp {
29040 *v = buf.get_u8()?;
29041 }
29042 __struct.name = CharArray::new(tmp);
29043 Ok(__struct)
29044 }
29045 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29046 let mut __tmp = BytesMut::new(bytes);
29047 #[allow(clippy::absurd_extreme_comparisons)]
29048 #[allow(unused_comparisons)]
29049 if __tmp.remaining() < Self::ENCODED_LEN {
29050 panic!(
29051 "buffer is too small (need {} bytes, but got {})",
29052 Self::ENCODED_LEN,
29053 __tmp.remaining(),
29054 )
29055 }
29056 __tmp.put_u16_le(self.seq);
29057 __tmp.put_u8(self.target_system);
29058 __tmp.put_u8(self.target_component);
29059 for val in &self.name {
29060 __tmp.put_u8(*val);
29061 }
29062 if matches!(version, MavlinkVersion::V2) {
29063 let len = __tmp.len();
29064 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29065 } else {
29066 __tmp.len()
29067 }
29068 }
29069}
29070#[doc = "Request script item with the sequence number seq. The response of the system to this message should be a SCRIPT_ITEM message."]
29071#[doc = ""]
29072#[doc = "ID: 181"]
29073#[derive(Debug, Clone, PartialEq)]
29074#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29075#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29076#[cfg_attr(feature = "ts", derive(TS))]
29077#[cfg_attr(feature = "ts", ts(export))]
29078pub struct SCRIPT_REQUEST_DATA {
29079 #[doc = "Sequence"]
29080 pub seq: u16,
29081 #[doc = "System ID"]
29082 pub target_system: u8,
29083 #[doc = "Component ID"]
29084 pub target_component: u8,
29085}
29086impl SCRIPT_REQUEST_DATA {
29087 pub const ENCODED_LEN: usize = 4usize;
29088 pub const DEFAULT: Self = Self {
29089 seq: 0_u16,
29090 target_system: 0_u8,
29091 target_component: 0_u8,
29092 };
29093 #[cfg(feature = "arbitrary")]
29094 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29095 use arbitrary::{Arbitrary, Unstructured};
29096 let mut buf = [0u8; 1024];
29097 rng.fill_bytes(&mut buf);
29098 let mut unstructured = Unstructured::new(&buf);
29099 Self::arbitrary(&mut unstructured).unwrap_or_default()
29100 }
29101}
29102impl Default for SCRIPT_REQUEST_DATA {
29103 fn default() -> Self {
29104 Self::DEFAULT.clone()
29105 }
29106}
29107impl MessageData for SCRIPT_REQUEST_DATA {
29108 type Message = MavMessage;
29109 const ID: u32 = 181u32;
29110 const NAME: &'static str = "SCRIPT_REQUEST";
29111 const EXTRA_CRC: u8 = 129u8;
29112 const ENCODED_LEN: usize = 4usize;
29113 fn deser(
29114 _version: MavlinkVersion,
29115 __input: &[u8],
29116 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29117 let avail_len = __input.len();
29118 let mut payload_buf = [0; Self::ENCODED_LEN];
29119 let mut buf = if avail_len < Self::ENCODED_LEN {
29120 payload_buf[0..avail_len].copy_from_slice(__input);
29121 Bytes::new(&payload_buf)
29122 } else {
29123 Bytes::new(__input)
29124 };
29125 let mut __struct = Self::default();
29126 __struct.seq = buf.get_u16_le()?;
29127 __struct.target_system = buf.get_u8()?;
29128 __struct.target_component = buf.get_u8()?;
29129 Ok(__struct)
29130 }
29131 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29132 let mut __tmp = BytesMut::new(bytes);
29133 #[allow(clippy::absurd_extreme_comparisons)]
29134 #[allow(unused_comparisons)]
29135 if __tmp.remaining() < Self::ENCODED_LEN {
29136 panic!(
29137 "buffer is too small (need {} bytes, but got {})",
29138 Self::ENCODED_LEN,
29139 __tmp.remaining(),
29140 )
29141 }
29142 __tmp.put_u16_le(self.seq);
29143 __tmp.put_u8(self.target_system);
29144 __tmp.put_u8(self.target_component);
29145 if matches!(version, MavlinkVersion::V2) {
29146 let len = __tmp.len();
29147 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29148 } else {
29149 __tmp.len()
29150 }
29151 }
29152}
29153#[doc = "Request the overall list of mission items from the system/component."]
29154#[doc = ""]
29155#[doc = "ID: 182"]
29156#[derive(Debug, Clone, PartialEq)]
29157#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29159#[cfg_attr(feature = "ts", derive(TS))]
29160#[cfg_attr(feature = "ts", ts(export))]
29161pub struct SCRIPT_REQUEST_LIST_DATA {
29162 #[doc = "System ID"]
29163 pub target_system: u8,
29164 #[doc = "Component ID"]
29165 pub target_component: u8,
29166}
29167impl SCRIPT_REQUEST_LIST_DATA {
29168 pub const ENCODED_LEN: usize = 2usize;
29169 pub const DEFAULT: Self = Self {
29170 target_system: 0_u8,
29171 target_component: 0_u8,
29172 };
29173 #[cfg(feature = "arbitrary")]
29174 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29175 use arbitrary::{Arbitrary, Unstructured};
29176 let mut buf = [0u8; 1024];
29177 rng.fill_bytes(&mut buf);
29178 let mut unstructured = Unstructured::new(&buf);
29179 Self::arbitrary(&mut unstructured).unwrap_or_default()
29180 }
29181}
29182impl Default for SCRIPT_REQUEST_LIST_DATA {
29183 fn default() -> Self {
29184 Self::DEFAULT.clone()
29185 }
29186}
29187impl MessageData for SCRIPT_REQUEST_LIST_DATA {
29188 type Message = MavMessage;
29189 const ID: u32 = 182u32;
29190 const NAME: &'static str = "SCRIPT_REQUEST_LIST";
29191 const EXTRA_CRC: u8 = 115u8;
29192 const ENCODED_LEN: usize = 2usize;
29193 fn deser(
29194 _version: MavlinkVersion,
29195 __input: &[u8],
29196 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29197 let avail_len = __input.len();
29198 let mut payload_buf = [0; Self::ENCODED_LEN];
29199 let mut buf = if avail_len < Self::ENCODED_LEN {
29200 payload_buf[0..avail_len].copy_from_slice(__input);
29201 Bytes::new(&payload_buf)
29202 } else {
29203 Bytes::new(__input)
29204 };
29205 let mut __struct = Self::default();
29206 __struct.target_system = buf.get_u8()?;
29207 __struct.target_component = buf.get_u8()?;
29208 Ok(__struct)
29209 }
29210 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29211 let mut __tmp = BytesMut::new(bytes);
29212 #[allow(clippy::absurd_extreme_comparisons)]
29213 #[allow(unused_comparisons)]
29214 if __tmp.remaining() < Self::ENCODED_LEN {
29215 panic!(
29216 "buffer is too small (need {} bytes, but got {})",
29217 Self::ENCODED_LEN,
29218 __tmp.remaining(),
29219 )
29220 }
29221 __tmp.put_u8(self.target_system);
29222 __tmp.put_u8(self.target_component);
29223 if matches!(version, MavlinkVersion::V2) {
29224 let len = __tmp.len();
29225 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29226 } else {
29227 __tmp.len()
29228 }
29229 }
29230}
29231#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
29232#[doc = ""]
29233#[doc = "ID: 126"]
29234#[derive(Debug, Clone, PartialEq)]
29235#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29236#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29237#[cfg_attr(feature = "ts", derive(TS))]
29238#[cfg_attr(feature = "ts", ts(export))]
29239pub struct SERIAL_CONTROL_DATA {
29240 #[doc = "Baudrate of transfer. Zero means no change."]
29241 pub baudrate: u32,
29242 #[doc = "Timeout for reply data"]
29243 pub timeout: u16,
29244 #[doc = "Serial control device type."]
29245 pub device: SerialControlDev,
29246 #[doc = "Bitmap of serial control flags."]
29247 pub flags: SerialControlFlag,
29248 #[doc = "how many bytes in this transfer"]
29249 pub count: u8,
29250 #[doc = "serial data"]
29251 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29252 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29253 pub data: [u8; 70],
29254 #[doc = "System ID"]
29255 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29256 pub target_system: u8,
29257 #[doc = "Component ID"]
29258 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29259 pub target_component: u8,
29260}
29261impl SERIAL_CONTROL_DATA {
29262 pub const ENCODED_LEN: usize = 81usize;
29263 pub const DEFAULT: Self = Self {
29264 baudrate: 0_u32,
29265 timeout: 0_u16,
29266 device: SerialControlDev::DEFAULT,
29267 flags: SerialControlFlag::DEFAULT,
29268 count: 0_u8,
29269 data: [0_u8; 70usize],
29270 target_system: 0_u8,
29271 target_component: 0_u8,
29272 };
29273 #[cfg(feature = "arbitrary")]
29274 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29275 use arbitrary::{Arbitrary, Unstructured};
29276 let mut buf = [0u8; 1024];
29277 rng.fill_bytes(&mut buf);
29278 let mut unstructured = Unstructured::new(&buf);
29279 Self::arbitrary(&mut unstructured).unwrap_or_default()
29280 }
29281}
29282impl Default for SERIAL_CONTROL_DATA {
29283 fn default() -> Self {
29284 Self::DEFAULT.clone()
29285 }
29286}
29287impl MessageData for SERIAL_CONTROL_DATA {
29288 type Message = MavMessage;
29289 const ID: u32 = 126u32;
29290 const NAME: &'static str = "SERIAL_CONTROL";
29291 const EXTRA_CRC: u8 = 220u8;
29292 const ENCODED_LEN: usize = 81usize;
29293 fn deser(
29294 _version: MavlinkVersion,
29295 __input: &[u8],
29296 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29297 let avail_len = __input.len();
29298 let mut payload_buf = [0; Self::ENCODED_LEN];
29299 let mut buf = if avail_len < Self::ENCODED_LEN {
29300 payload_buf[0..avail_len].copy_from_slice(__input);
29301 Bytes::new(&payload_buf)
29302 } else {
29303 Bytes::new(__input)
29304 };
29305 let mut __struct = Self::default();
29306 __struct.baudrate = buf.get_u32_le()?;
29307 __struct.timeout = buf.get_u16_le()?;
29308 let tmp = buf.get_u8()?;
29309 __struct.device =
29310 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29311 enum_type: "SerialControlDev",
29312 value: tmp as u64,
29313 })?;
29314 let tmp = buf.get_u8()?;
29315 __struct.flags = SerialControlFlag::from_bits(tmp as <SerialControlFlag as Flags>::Bits)
29316 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29317 flag_type: "SerialControlFlag",
29318 value: tmp as u64,
29319 })?;
29320 __struct.count = buf.get_u8()?;
29321 for v in &mut __struct.data {
29322 let val = buf.get_u8()?;
29323 *v = val;
29324 }
29325 __struct.target_system = buf.get_u8()?;
29326 __struct.target_component = buf.get_u8()?;
29327 Ok(__struct)
29328 }
29329 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29330 let mut __tmp = BytesMut::new(bytes);
29331 #[allow(clippy::absurd_extreme_comparisons)]
29332 #[allow(unused_comparisons)]
29333 if __tmp.remaining() < Self::ENCODED_LEN {
29334 panic!(
29335 "buffer is too small (need {} bytes, but got {})",
29336 Self::ENCODED_LEN,
29337 __tmp.remaining(),
29338 )
29339 }
29340 __tmp.put_u32_le(self.baudrate);
29341 __tmp.put_u16_le(self.timeout);
29342 __tmp.put_u8(self.device as u8);
29343 __tmp.put_u8(self.flags.bits() as u8);
29344 __tmp.put_u8(self.count);
29345 for val in &self.data {
29346 __tmp.put_u8(*val);
29347 }
29348 if matches!(version, MavlinkVersion::V2) {
29349 __tmp.put_u8(self.target_system);
29350 __tmp.put_u8(self.target_component);
29351 let len = __tmp.len();
29352 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29353 } else {
29354 __tmp.len()
29355 }
29356 }
29357}
29358#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
29359#[doc = ""]
29360#[doc = "ID: 36"]
29361#[derive(Debug, Clone, PartialEq)]
29362#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29363#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29364#[cfg_attr(feature = "ts", derive(TS))]
29365#[cfg_attr(feature = "ts", ts(export))]
29366pub struct SERVO_OUTPUT_RAW_DATA {
29367 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29368 pub time_usec: u32,
29369 #[doc = "Servo output 1 value"]
29370 pub servo1_raw: u16,
29371 #[doc = "Servo output 2 value"]
29372 pub servo2_raw: u16,
29373 #[doc = "Servo output 3 value"]
29374 pub servo3_raw: u16,
29375 #[doc = "Servo output 4 value"]
29376 pub servo4_raw: u16,
29377 #[doc = "Servo output 5 value"]
29378 pub servo5_raw: u16,
29379 #[doc = "Servo output 6 value"]
29380 pub servo6_raw: u16,
29381 #[doc = "Servo output 7 value"]
29382 pub servo7_raw: u16,
29383 #[doc = "Servo output 8 value"]
29384 pub servo8_raw: u16,
29385 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
29386 pub port: u8,
29387 #[doc = "Servo output 9 value"]
29388 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29389 pub servo9_raw: u16,
29390 #[doc = "Servo output 10 value"]
29391 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29392 pub servo10_raw: u16,
29393 #[doc = "Servo output 11 value"]
29394 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29395 pub servo11_raw: u16,
29396 #[doc = "Servo output 12 value"]
29397 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29398 pub servo12_raw: u16,
29399 #[doc = "Servo output 13 value"]
29400 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29401 pub servo13_raw: u16,
29402 #[doc = "Servo output 14 value"]
29403 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29404 pub servo14_raw: u16,
29405 #[doc = "Servo output 15 value"]
29406 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29407 pub servo15_raw: u16,
29408 #[doc = "Servo output 16 value"]
29409 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29410 pub servo16_raw: u16,
29411}
29412impl SERVO_OUTPUT_RAW_DATA {
29413 pub const ENCODED_LEN: usize = 37usize;
29414 pub const DEFAULT: Self = Self {
29415 time_usec: 0_u32,
29416 servo1_raw: 0_u16,
29417 servo2_raw: 0_u16,
29418 servo3_raw: 0_u16,
29419 servo4_raw: 0_u16,
29420 servo5_raw: 0_u16,
29421 servo6_raw: 0_u16,
29422 servo7_raw: 0_u16,
29423 servo8_raw: 0_u16,
29424 port: 0_u8,
29425 servo9_raw: 0_u16,
29426 servo10_raw: 0_u16,
29427 servo11_raw: 0_u16,
29428 servo12_raw: 0_u16,
29429 servo13_raw: 0_u16,
29430 servo14_raw: 0_u16,
29431 servo15_raw: 0_u16,
29432 servo16_raw: 0_u16,
29433 };
29434 #[cfg(feature = "arbitrary")]
29435 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29436 use arbitrary::{Arbitrary, Unstructured};
29437 let mut buf = [0u8; 1024];
29438 rng.fill_bytes(&mut buf);
29439 let mut unstructured = Unstructured::new(&buf);
29440 Self::arbitrary(&mut unstructured).unwrap_or_default()
29441 }
29442}
29443impl Default for SERVO_OUTPUT_RAW_DATA {
29444 fn default() -> Self {
29445 Self::DEFAULT.clone()
29446 }
29447}
29448impl MessageData for SERVO_OUTPUT_RAW_DATA {
29449 type Message = MavMessage;
29450 const ID: u32 = 36u32;
29451 const NAME: &'static str = "SERVO_OUTPUT_RAW";
29452 const EXTRA_CRC: u8 = 222u8;
29453 const ENCODED_LEN: usize = 37usize;
29454 fn deser(
29455 _version: MavlinkVersion,
29456 __input: &[u8],
29457 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29458 let avail_len = __input.len();
29459 let mut payload_buf = [0; Self::ENCODED_LEN];
29460 let mut buf = if avail_len < Self::ENCODED_LEN {
29461 payload_buf[0..avail_len].copy_from_slice(__input);
29462 Bytes::new(&payload_buf)
29463 } else {
29464 Bytes::new(__input)
29465 };
29466 let mut __struct = Self::default();
29467 __struct.time_usec = buf.get_u32_le()?;
29468 __struct.servo1_raw = buf.get_u16_le()?;
29469 __struct.servo2_raw = buf.get_u16_le()?;
29470 __struct.servo3_raw = buf.get_u16_le()?;
29471 __struct.servo4_raw = buf.get_u16_le()?;
29472 __struct.servo5_raw = buf.get_u16_le()?;
29473 __struct.servo6_raw = buf.get_u16_le()?;
29474 __struct.servo7_raw = buf.get_u16_le()?;
29475 __struct.servo8_raw = buf.get_u16_le()?;
29476 __struct.port = buf.get_u8()?;
29477 __struct.servo9_raw = buf.get_u16_le()?;
29478 __struct.servo10_raw = buf.get_u16_le()?;
29479 __struct.servo11_raw = buf.get_u16_le()?;
29480 __struct.servo12_raw = buf.get_u16_le()?;
29481 __struct.servo13_raw = buf.get_u16_le()?;
29482 __struct.servo14_raw = buf.get_u16_le()?;
29483 __struct.servo15_raw = buf.get_u16_le()?;
29484 __struct.servo16_raw = buf.get_u16_le()?;
29485 Ok(__struct)
29486 }
29487 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29488 let mut __tmp = BytesMut::new(bytes);
29489 #[allow(clippy::absurd_extreme_comparisons)]
29490 #[allow(unused_comparisons)]
29491 if __tmp.remaining() < Self::ENCODED_LEN {
29492 panic!(
29493 "buffer is too small (need {} bytes, but got {})",
29494 Self::ENCODED_LEN,
29495 __tmp.remaining(),
29496 )
29497 }
29498 __tmp.put_u32_le(self.time_usec);
29499 __tmp.put_u16_le(self.servo1_raw);
29500 __tmp.put_u16_le(self.servo2_raw);
29501 __tmp.put_u16_le(self.servo3_raw);
29502 __tmp.put_u16_le(self.servo4_raw);
29503 __tmp.put_u16_le(self.servo5_raw);
29504 __tmp.put_u16_le(self.servo6_raw);
29505 __tmp.put_u16_le(self.servo7_raw);
29506 __tmp.put_u16_le(self.servo8_raw);
29507 __tmp.put_u8(self.port);
29508 if matches!(version, MavlinkVersion::V2) {
29509 __tmp.put_u16_le(self.servo9_raw);
29510 __tmp.put_u16_le(self.servo10_raw);
29511 __tmp.put_u16_le(self.servo11_raw);
29512 __tmp.put_u16_le(self.servo12_raw);
29513 __tmp.put_u16_le(self.servo13_raw);
29514 __tmp.put_u16_le(self.servo14_raw);
29515 __tmp.put_u16_le(self.servo15_raw);
29516 __tmp.put_u16_le(self.servo16_raw);
29517 let len = __tmp.len();
29518 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29519 } else {
29520 __tmp.len()
29521 }
29522 }
29523}
29524#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
29525#[doc = ""]
29526#[doc = "ID: 256"]
29527#[derive(Debug, Clone, PartialEq)]
29528#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29529#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29530#[cfg_attr(feature = "ts", derive(TS))]
29531#[cfg_attr(feature = "ts", ts(export))]
29532pub struct SETUP_SIGNING_DATA {
29533 #[doc = "initial timestamp"]
29534 pub initial_timestamp: u64,
29535 #[doc = "system id of the target"]
29536 pub target_system: u8,
29537 #[doc = "component ID of the target"]
29538 pub target_component: u8,
29539 #[doc = "signing key"]
29540 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29541 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29542 pub secret_key: [u8; 32],
29543}
29544impl SETUP_SIGNING_DATA {
29545 pub const ENCODED_LEN: usize = 42usize;
29546 pub const DEFAULT: Self = Self {
29547 initial_timestamp: 0_u64,
29548 target_system: 0_u8,
29549 target_component: 0_u8,
29550 secret_key: [0_u8; 32usize],
29551 };
29552 #[cfg(feature = "arbitrary")]
29553 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29554 use arbitrary::{Arbitrary, Unstructured};
29555 let mut buf = [0u8; 1024];
29556 rng.fill_bytes(&mut buf);
29557 let mut unstructured = Unstructured::new(&buf);
29558 Self::arbitrary(&mut unstructured).unwrap_or_default()
29559 }
29560}
29561impl Default for SETUP_SIGNING_DATA {
29562 fn default() -> Self {
29563 Self::DEFAULT.clone()
29564 }
29565}
29566impl MessageData for SETUP_SIGNING_DATA {
29567 type Message = MavMessage;
29568 const ID: u32 = 256u32;
29569 const NAME: &'static str = "SETUP_SIGNING";
29570 const EXTRA_CRC: u8 = 71u8;
29571 const ENCODED_LEN: usize = 42usize;
29572 fn deser(
29573 _version: MavlinkVersion,
29574 __input: &[u8],
29575 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29576 let avail_len = __input.len();
29577 let mut payload_buf = [0; Self::ENCODED_LEN];
29578 let mut buf = if avail_len < Self::ENCODED_LEN {
29579 payload_buf[0..avail_len].copy_from_slice(__input);
29580 Bytes::new(&payload_buf)
29581 } else {
29582 Bytes::new(__input)
29583 };
29584 let mut __struct = Self::default();
29585 __struct.initial_timestamp = buf.get_u64_le()?;
29586 __struct.target_system = buf.get_u8()?;
29587 __struct.target_component = buf.get_u8()?;
29588 for v in &mut __struct.secret_key {
29589 let val = buf.get_u8()?;
29590 *v = val;
29591 }
29592 Ok(__struct)
29593 }
29594 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29595 let mut __tmp = BytesMut::new(bytes);
29596 #[allow(clippy::absurd_extreme_comparisons)]
29597 #[allow(unused_comparisons)]
29598 if __tmp.remaining() < Self::ENCODED_LEN {
29599 panic!(
29600 "buffer is too small (need {} bytes, but got {})",
29601 Self::ENCODED_LEN,
29602 __tmp.remaining(),
29603 )
29604 }
29605 __tmp.put_u64_le(self.initial_timestamp);
29606 __tmp.put_u8(self.target_system);
29607 __tmp.put_u8(self.target_component);
29608 for val in &self.secret_key {
29609 __tmp.put_u8(*val);
29610 }
29611 if matches!(version, MavlinkVersion::V2) {
29612 let len = __tmp.len();
29613 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29614 } else {
29615 __tmp.len()
29616 }
29617 }
29618}
29619#[doc = "Set the vehicle attitude and body angular rates."]
29620#[doc = ""]
29621#[doc = "ID: 139"]
29622#[derive(Debug, Clone, PartialEq)]
29623#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29624#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29625#[cfg_attr(feature = "ts", derive(TS))]
29626#[cfg_attr(feature = "ts", ts(export))]
29627pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
29628 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29629 pub time_usec: u64,
29630 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
29631 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29632 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29633 pub controls: [f32; 8],
29634 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
29635 pub group_mlx: u8,
29636 #[doc = "System ID"]
29637 pub target_system: u8,
29638 #[doc = "Component ID"]
29639 pub target_component: u8,
29640}
29641impl SET_ACTUATOR_CONTROL_TARGET_DATA {
29642 pub const ENCODED_LEN: usize = 43usize;
29643 pub const DEFAULT: Self = Self {
29644 time_usec: 0_u64,
29645 controls: [0.0_f32; 8usize],
29646 group_mlx: 0_u8,
29647 target_system: 0_u8,
29648 target_component: 0_u8,
29649 };
29650 #[cfg(feature = "arbitrary")]
29651 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29652 use arbitrary::{Arbitrary, Unstructured};
29653 let mut buf = [0u8; 1024];
29654 rng.fill_bytes(&mut buf);
29655 let mut unstructured = Unstructured::new(&buf);
29656 Self::arbitrary(&mut unstructured).unwrap_or_default()
29657 }
29658}
29659impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
29660 fn default() -> Self {
29661 Self::DEFAULT.clone()
29662 }
29663}
29664impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
29665 type Message = MavMessage;
29666 const ID: u32 = 139u32;
29667 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
29668 const EXTRA_CRC: u8 = 168u8;
29669 const ENCODED_LEN: usize = 43usize;
29670 fn deser(
29671 _version: MavlinkVersion,
29672 __input: &[u8],
29673 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29674 let avail_len = __input.len();
29675 let mut payload_buf = [0; Self::ENCODED_LEN];
29676 let mut buf = if avail_len < Self::ENCODED_LEN {
29677 payload_buf[0..avail_len].copy_from_slice(__input);
29678 Bytes::new(&payload_buf)
29679 } else {
29680 Bytes::new(__input)
29681 };
29682 let mut __struct = Self::default();
29683 __struct.time_usec = buf.get_u64_le()?;
29684 for v in &mut __struct.controls {
29685 let val = buf.get_f32_le()?;
29686 *v = val;
29687 }
29688 __struct.group_mlx = buf.get_u8()?;
29689 __struct.target_system = buf.get_u8()?;
29690 __struct.target_component = buf.get_u8()?;
29691 Ok(__struct)
29692 }
29693 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29694 let mut __tmp = BytesMut::new(bytes);
29695 #[allow(clippy::absurd_extreme_comparisons)]
29696 #[allow(unused_comparisons)]
29697 if __tmp.remaining() < Self::ENCODED_LEN {
29698 panic!(
29699 "buffer is too small (need {} bytes, but got {})",
29700 Self::ENCODED_LEN,
29701 __tmp.remaining(),
29702 )
29703 }
29704 __tmp.put_u64_le(self.time_usec);
29705 for val in &self.controls {
29706 __tmp.put_f32_le(*val);
29707 }
29708 __tmp.put_u8(self.group_mlx);
29709 __tmp.put_u8(self.target_system);
29710 __tmp.put_u8(self.target_component);
29711 if matches!(version, MavlinkVersion::V2) {
29712 let len = __tmp.len();
29713 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29714 } else {
29715 __tmp.len()
29716 }
29717 }
29718}
29719#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
29720#[doc = ""]
29721#[doc = "ID: 82"]
29722#[derive(Debug, Clone, PartialEq)]
29723#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29724#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29725#[cfg_attr(feature = "ts", derive(TS))]
29726#[cfg_attr(feature = "ts", ts(export))]
29727pub struct SET_ATTITUDE_TARGET_DATA {
29728 #[doc = "Timestamp (time since system boot)."]
29729 pub time_boot_ms: u32,
29730 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
29731 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29732 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29733 pub q: [f32; 4],
29734 #[doc = "Body roll rate"]
29735 pub body_roll_rate: f32,
29736 #[doc = "Body pitch rate"]
29737 pub body_pitch_rate: f32,
29738 #[doc = "Body yaw rate"]
29739 pub body_yaw_rate: f32,
29740 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
29741 pub thrust: f32,
29742 #[doc = "System ID"]
29743 pub target_system: u8,
29744 #[doc = "Component ID"]
29745 pub target_component: u8,
29746 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
29747 pub type_mask: AttitudeTargetTypemask,
29748 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
29749 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29750 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29751 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29752 pub thrust_body: [f32; 3],
29753}
29754impl SET_ATTITUDE_TARGET_DATA {
29755 pub const ENCODED_LEN: usize = 51usize;
29756 pub const DEFAULT: Self = Self {
29757 time_boot_ms: 0_u32,
29758 q: [0.0_f32; 4usize],
29759 body_roll_rate: 0.0_f32,
29760 body_pitch_rate: 0.0_f32,
29761 body_yaw_rate: 0.0_f32,
29762 thrust: 0.0_f32,
29763 target_system: 0_u8,
29764 target_component: 0_u8,
29765 type_mask: AttitudeTargetTypemask::DEFAULT,
29766 thrust_body: [0.0_f32; 3usize],
29767 };
29768 #[cfg(feature = "arbitrary")]
29769 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29770 use arbitrary::{Arbitrary, Unstructured};
29771 let mut buf = [0u8; 1024];
29772 rng.fill_bytes(&mut buf);
29773 let mut unstructured = Unstructured::new(&buf);
29774 Self::arbitrary(&mut unstructured).unwrap_or_default()
29775 }
29776}
29777impl Default for SET_ATTITUDE_TARGET_DATA {
29778 fn default() -> Self {
29779 Self::DEFAULT.clone()
29780 }
29781}
29782impl MessageData for SET_ATTITUDE_TARGET_DATA {
29783 type Message = MavMessage;
29784 const ID: u32 = 82u32;
29785 const NAME: &'static str = "SET_ATTITUDE_TARGET";
29786 const EXTRA_CRC: u8 = 49u8;
29787 const ENCODED_LEN: usize = 51usize;
29788 fn deser(
29789 _version: MavlinkVersion,
29790 __input: &[u8],
29791 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29792 let avail_len = __input.len();
29793 let mut payload_buf = [0; Self::ENCODED_LEN];
29794 let mut buf = if avail_len < Self::ENCODED_LEN {
29795 payload_buf[0..avail_len].copy_from_slice(__input);
29796 Bytes::new(&payload_buf)
29797 } else {
29798 Bytes::new(__input)
29799 };
29800 let mut __struct = Self::default();
29801 __struct.time_boot_ms = buf.get_u32_le()?;
29802 for v in &mut __struct.q {
29803 let val = buf.get_f32_le()?;
29804 *v = val;
29805 }
29806 __struct.body_roll_rate = buf.get_f32_le()?;
29807 __struct.body_pitch_rate = buf.get_f32_le()?;
29808 __struct.body_yaw_rate = buf.get_f32_le()?;
29809 __struct.thrust = buf.get_f32_le()?;
29810 __struct.target_system = buf.get_u8()?;
29811 __struct.target_component = buf.get_u8()?;
29812 let tmp = buf.get_u8()?;
29813 __struct.type_mask =
29814 AttitudeTargetTypemask::from_bits(tmp as <AttitudeTargetTypemask as Flags>::Bits)
29815 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29816 flag_type: "AttitudeTargetTypemask",
29817 value: tmp as u64,
29818 })?;
29819 for v in &mut __struct.thrust_body {
29820 let val = buf.get_f32_le()?;
29821 *v = val;
29822 }
29823 Ok(__struct)
29824 }
29825 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29826 let mut __tmp = BytesMut::new(bytes);
29827 #[allow(clippy::absurd_extreme_comparisons)]
29828 #[allow(unused_comparisons)]
29829 if __tmp.remaining() < Self::ENCODED_LEN {
29830 panic!(
29831 "buffer is too small (need {} bytes, but got {})",
29832 Self::ENCODED_LEN,
29833 __tmp.remaining(),
29834 )
29835 }
29836 __tmp.put_u32_le(self.time_boot_ms);
29837 for val in &self.q {
29838 __tmp.put_f32_le(*val);
29839 }
29840 __tmp.put_f32_le(self.body_roll_rate);
29841 __tmp.put_f32_le(self.body_pitch_rate);
29842 __tmp.put_f32_le(self.body_yaw_rate);
29843 __tmp.put_f32_le(self.thrust);
29844 __tmp.put_u8(self.target_system);
29845 __tmp.put_u8(self.target_component);
29846 __tmp.put_u8(self.type_mask.bits() as u8);
29847 if matches!(version, MavlinkVersion::V2) {
29848 for val in &self.thrust_body {
29849 __tmp.put_f32_le(*val);
29850 }
29851 let len = __tmp.len();
29852 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29853 } else {
29854 __tmp.len()
29855 }
29856 }
29857}
29858#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
29859#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
29860#[doc = ""]
29861#[doc = "ID: 48"]
29862#[derive(Debug, Clone, PartialEq)]
29863#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29864#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29865#[cfg_attr(feature = "ts", derive(TS))]
29866#[cfg_attr(feature = "ts", ts(export))]
29867pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
29868 #[doc = "Latitude (WGS84)"]
29869 pub latitude: i32,
29870 #[doc = "Longitude (WGS84)"]
29871 pub longitude: i32,
29872 #[doc = "Altitude (MSL). Positive for up."]
29873 pub altitude: i32,
29874 #[doc = "System ID"]
29875 pub target_system: u8,
29876 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29877 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29878 pub time_usec: u64,
29879}
29880impl SET_GPS_GLOBAL_ORIGIN_DATA {
29881 pub const ENCODED_LEN: usize = 21usize;
29882 pub const DEFAULT: Self = Self {
29883 latitude: 0_i32,
29884 longitude: 0_i32,
29885 altitude: 0_i32,
29886 target_system: 0_u8,
29887 time_usec: 0_u64,
29888 };
29889 #[cfg(feature = "arbitrary")]
29890 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29891 use arbitrary::{Arbitrary, Unstructured};
29892 let mut buf = [0u8; 1024];
29893 rng.fill_bytes(&mut buf);
29894 let mut unstructured = Unstructured::new(&buf);
29895 Self::arbitrary(&mut unstructured).unwrap_or_default()
29896 }
29897}
29898impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
29899 fn default() -> Self {
29900 Self::DEFAULT.clone()
29901 }
29902}
29903impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
29904 type Message = MavMessage;
29905 const ID: u32 = 48u32;
29906 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
29907 const EXTRA_CRC: u8 = 41u8;
29908 const ENCODED_LEN: usize = 21usize;
29909 fn deser(
29910 _version: MavlinkVersion,
29911 __input: &[u8],
29912 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29913 let avail_len = __input.len();
29914 let mut payload_buf = [0; Self::ENCODED_LEN];
29915 let mut buf = if avail_len < Self::ENCODED_LEN {
29916 payload_buf[0..avail_len].copy_from_slice(__input);
29917 Bytes::new(&payload_buf)
29918 } else {
29919 Bytes::new(__input)
29920 };
29921 let mut __struct = Self::default();
29922 __struct.latitude = buf.get_i32_le()?;
29923 __struct.longitude = buf.get_i32_le()?;
29924 __struct.altitude = buf.get_i32_le()?;
29925 __struct.target_system = buf.get_u8()?;
29926 __struct.time_usec = buf.get_u64_le()?;
29927 Ok(__struct)
29928 }
29929 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29930 let mut __tmp = BytesMut::new(bytes);
29931 #[allow(clippy::absurd_extreme_comparisons)]
29932 #[allow(unused_comparisons)]
29933 if __tmp.remaining() < Self::ENCODED_LEN {
29934 panic!(
29935 "buffer is too small (need {} bytes, but got {})",
29936 Self::ENCODED_LEN,
29937 __tmp.remaining(),
29938 )
29939 }
29940 __tmp.put_i32_le(self.latitude);
29941 __tmp.put_i32_le(self.longitude);
29942 __tmp.put_i32_le(self.altitude);
29943 __tmp.put_u8(self.target_system);
29944 if matches!(version, MavlinkVersion::V2) {
29945 __tmp.put_u64_le(self.time_usec);
29946 let len = __tmp.len();
29947 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29948 } else {
29949 __tmp.len()
29950 }
29951 }
29952}
29953#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
29954#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
29955#[doc = ""]
29956#[doc = "ID: 243"]
29957#[derive(Debug, Clone, PartialEq)]
29958#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29959#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29960#[cfg_attr(feature = "ts", derive(TS))]
29961#[cfg_attr(feature = "ts", ts(export))]
29962pub struct SET_HOME_POSITION_DATA {
29963 #[doc = "Latitude (WGS84)"]
29964 pub latitude: i32,
29965 #[doc = "Longitude (WGS84)"]
29966 pub longitude: i32,
29967 #[doc = "Altitude (MSL). Positive for up."]
29968 pub altitude: i32,
29969 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
29970 pub x: f32,
29971 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
29972 pub y: f32,
29973 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
29974 pub z: f32,
29975 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
29976 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29977 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29978 pub q: [f32; 4],
29979 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
29980 pub approach_x: f32,
29981 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
29982 pub approach_y: f32,
29983 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
29984 pub approach_z: f32,
29985 #[doc = "System ID."]
29986 pub target_system: u8,
29987 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29988 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29989 pub time_usec: u64,
29990}
29991impl SET_HOME_POSITION_DATA {
29992 pub const ENCODED_LEN: usize = 61usize;
29993 pub const DEFAULT: Self = Self {
29994 latitude: 0_i32,
29995 longitude: 0_i32,
29996 altitude: 0_i32,
29997 x: 0.0_f32,
29998 y: 0.0_f32,
29999 z: 0.0_f32,
30000 q: [0.0_f32; 4usize],
30001 approach_x: 0.0_f32,
30002 approach_y: 0.0_f32,
30003 approach_z: 0.0_f32,
30004 target_system: 0_u8,
30005 time_usec: 0_u64,
30006 };
30007 #[cfg(feature = "arbitrary")]
30008 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30009 use arbitrary::{Arbitrary, Unstructured};
30010 let mut buf = [0u8; 1024];
30011 rng.fill_bytes(&mut buf);
30012 let mut unstructured = Unstructured::new(&buf);
30013 Self::arbitrary(&mut unstructured).unwrap_or_default()
30014 }
30015}
30016impl Default for SET_HOME_POSITION_DATA {
30017 fn default() -> Self {
30018 Self::DEFAULT.clone()
30019 }
30020}
30021impl MessageData for SET_HOME_POSITION_DATA {
30022 type Message = MavMessage;
30023 const ID: u32 = 243u32;
30024 const NAME: &'static str = "SET_HOME_POSITION";
30025 const EXTRA_CRC: u8 = 85u8;
30026 const ENCODED_LEN: usize = 61usize;
30027 fn deser(
30028 _version: MavlinkVersion,
30029 __input: &[u8],
30030 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30031 let avail_len = __input.len();
30032 let mut payload_buf = [0; Self::ENCODED_LEN];
30033 let mut buf = if avail_len < Self::ENCODED_LEN {
30034 payload_buf[0..avail_len].copy_from_slice(__input);
30035 Bytes::new(&payload_buf)
30036 } else {
30037 Bytes::new(__input)
30038 };
30039 let mut __struct = Self::default();
30040 __struct.latitude = buf.get_i32_le()?;
30041 __struct.longitude = buf.get_i32_le()?;
30042 __struct.altitude = buf.get_i32_le()?;
30043 __struct.x = buf.get_f32_le()?;
30044 __struct.y = buf.get_f32_le()?;
30045 __struct.z = buf.get_f32_le()?;
30046 for v in &mut __struct.q {
30047 let val = buf.get_f32_le()?;
30048 *v = val;
30049 }
30050 __struct.approach_x = buf.get_f32_le()?;
30051 __struct.approach_y = buf.get_f32_le()?;
30052 __struct.approach_z = buf.get_f32_le()?;
30053 __struct.target_system = buf.get_u8()?;
30054 __struct.time_usec = buf.get_u64_le()?;
30055 Ok(__struct)
30056 }
30057 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30058 let mut __tmp = BytesMut::new(bytes);
30059 #[allow(clippy::absurd_extreme_comparisons)]
30060 #[allow(unused_comparisons)]
30061 if __tmp.remaining() < Self::ENCODED_LEN {
30062 panic!(
30063 "buffer is too small (need {} bytes, but got {})",
30064 Self::ENCODED_LEN,
30065 __tmp.remaining(),
30066 )
30067 }
30068 __tmp.put_i32_le(self.latitude);
30069 __tmp.put_i32_le(self.longitude);
30070 __tmp.put_i32_le(self.altitude);
30071 __tmp.put_f32_le(self.x);
30072 __tmp.put_f32_le(self.y);
30073 __tmp.put_f32_le(self.z);
30074 for val in &self.q {
30075 __tmp.put_f32_le(*val);
30076 }
30077 __tmp.put_f32_le(self.approach_x);
30078 __tmp.put_f32_le(self.approach_y);
30079 __tmp.put_f32_le(self.approach_z);
30080 __tmp.put_u8(self.target_system);
30081 if matches!(version, MavlinkVersion::V2) {
30082 __tmp.put_u64_le(self.time_usec);
30083 let len = __tmp.len();
30084 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30085 } else {
30086 __tmp.len()
30087 }
30088 }
30089}
30090#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
30091#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
30092#[doc = ""]
30093#[doc = "ID: 11"]
30094#[derive(Debug, Clone, PartialEq)]
30095#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30096#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30097#[cfg_attr(feature = "ts", derive(TS))]
30098#[cfg_attr(feature = "ts", ts(export))]
30099pub struct SET_MODE_DATA {
30100 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
30101 pub custom_mode: u32,
30102 #[doc = "The system setting the mode"]
30103 pub target_system: u8,
30104 #[doc = "The new base mode."]
30105 pub base_mode: MavMode,
30106}
30107impl SET_MODE_DATA {
30108 pub const ENCODED_LEN: usize = 6usize;
30109 pub const DEFAULT: Self = Self {
30110 custom_mode: 0_u32,
30111 target_system: 0_u8,
30112 base_mode: MavMode::DEFAULT,
30113 };
30114 #[cfg(feature = "arbitrary")]
30115 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30116 use arbitrary::{Arbitrary, Unstructured};
30117 let mut buf = [0u8; 1024];
30118 rng.fill_bytes(&mut buf);
30119 let mut unstructured = Unstructured::new(&buf);
30120 Self::arbitrary(&mut unstructured).unwrap_or_default()
30121 }
30122}
30123impl Default for SET_MODE_DATA {
30124 fn default() -> Self {
30125 Self::DEFAULT.clone()
30126 }
30127}
30128impl MessageData for SET_MODE_DATA {
30129 type Message = MavMessage;
30130 const ID: u32 = 11u32;
30131 const NAME: &'static str = "SET_MODE";
30132 const EXTRA_CRC: u8 = 89u8;
30133 const ENCODED_LEN: usize = 6usize;
30134 fn deser(
30135 _version: MavlinkVersion,
30136 __input: &[u8],
30137 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30138 let avail_len = __input.len();
30139 let mut payload_buf = [0; Self::ENCODED_LEN];
30140 let mut buf = if avail_len < Self::ENCODED_LEN {
30141 payload_buf[0..avail_len].copy_from_slice(__input);
30142 Bytes::new(&payload_buf)
30143 } else {
30144 Bytes::new(__input)
30145 };
30146 let mut __struct = Self::default();
30147 __struct.custom_mode = buf.get_u32_le()?;
30148 __struct.target_system = buf.get_u8()?;
30149 let tmp = buf.get_u8()?;
30150 __struct.base_mode =
30151 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30152 enum_type: "MavMode",
30153 value: tmp as u64,
30154 })?;
30155 Ok(__struct)
30156 }
30157 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30158 let mut __tmp = BytesMut::new(bytes);
30159 #[allow(clippy::absurd_extreme_comparisons)]
30160 #[allow(unused_comparisons)]
30161 if __tmp.remaining() < Self::ENCODED_LEN {
30162 panic!(
30163 "buffer is too small (need {} bytes, but got {})",
30164 Self::ENCODED_LEN,
30165 __tmp.remaining(),
30166 )
30167 }
30168 __tmp.put_u32_le(self.custom_mode);
30169 __tmp.put_u8(self.target_system);
30170 __tmp.put_u8(self.base_mode as u8);
30171 if matches!(version, MavlinkVersion::V2) {
30172 let len = __tmp.len();
30173 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30174 } else {
30175 __tmp.len()
30176 }
30177 }
30178}
30179#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
30180#[doc = ""]
30181#[doc = "ID: 86"]
30182#[derive(Debug, Clone, PartialEq)]
30183#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30185#[cfg_attr(feature = "ts", derive(TS))]
30186#[cfg_attr(feature = "ts", ts(export))]
30187pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
30188 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
30189 pub time_boot_ms: u32,
30190 #[doc = "Latitude in WGS84 frame"]
30191 pub lat_int: i32,
30192 #[doc = "Longitude in WGS84 frame"]
30193 pub lon_int: i32,
30194 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
30195 pub alt: f32,
30196 #[doc = "X velocity in NED frame"]
30197 pub vx: f32,
30198 #[doc = "Y velocity in NED frame"]
30199 pub vy: f32,
30200 #[doc = "Z velocity in NED frame"]
30201 pub vz: f32,
30202 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
30203 pub afx: f32,
30204 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
30205 pub afy: f32,
30206 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
30207 pub afz: f32,
30208 #[doc = "yaw setpoint"]
30209 pub yaw: f32,
30210 #[doc = "yaw rate setpoint"]
30211 pub yaw_rate: f32,
30212 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
30213 pub type_mask: PositionTargetTypemask,
30214 #[doc = "System ID"]
30215 pub target_system: u8,
30216 #[doc = "Component ID"]
30217 pub target_component: u8,
30218 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
30219 pub coordinate_frame: MavFrame,
30220}
30221impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
30222 pub const ENCODED_LEN: usize = 53usize;
30223 pub const DEFAULT: Self = Self {
30224 time_boot_ms: 0_u32,
30225 lat_int: 0_i32,
30226 lon_int: 0_i32,
30227 alt: 0.0_f32,
30228 vx: 0.0_f32,
30229 vy: 0.0_f32,
30230 vz: 0.0_f32,
30231 afx: 0.0_f32,
30232 afy: 0.0_f32,
30233 afz: 0.0_f32,
30234 yaw: 0.0_f32,
30235 yaw_rate: 0.0_f32,
30236 type_mask: PositionTargetTypemask::DEFAULT,
30237 target_system: 0_u8,
30238 target_component: 0_u8,
30239 coordinate_frame: MavFrame::DEFAULT,
30240 };
30241 #[cfg(feature = "arbitrary")]
30242 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30243 use arbitrary::{Arbitrary, Unstructured};
30244 let mut buf = [0u8; 1024];
30245 rng.fill_bytes(&mut buf);
30246 let mut unstructured = Unstructured::new(&buf);
30247 Self::arbitrary(&mut unstructured).unwrap_or_default()
30248 }
30249}
30250impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
30251 fn default() -> Self {
30252 Self::DEFAULT.clone()
30253 }
30254}
30255impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
30256 type Message = MavMessage;
30257 const ID: u32 = 86u32;
30258 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
30259 const EXTRA_CRC: u8 = 5u8;
30260 const ENCODED_LEN: usize = 53usize;
30261 fn deser(
30262 _version: MavlinkVersion,
30263 __input: &[u8],
30264 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30265 let avail_len = __input.len();
30266 let mut payload_buf = [0; Self::ENCODED_LEN];
30267 let mut buf = if avail_len < Self::ENCODED_LEN {
30268 payload_buf[0..avail_len].copy_from_slice(__input);
30269 Bytes::new(&payload_buf)
30270 } else {
30271 Bytes::new(__input)
30272 };
30273 let mut __struct = Self::default();
30274 __struct.time_boot_ms = buf.get_u32_le()?;
30275 __struct.lat_int = buf.get_i32_le()?;
30276 __struct.lon_int = buf.get_i32_le()?;
30277 __struct.alt = buf.get_f32_le()?;
30278 __struct.vx = buf.get_f32_le()?;
30279 __struct.vy = buf.get_f32_le()?;
30280 __struct.vz = buf.get_f32_le()?;
30281 __struct.afx = buf.get_f32_le()?;
30282 __struct.afy = buf.get_f32_le()?;
30283 __struct.afz = buf.get_f32_le()?;
30284 __struct.yaw = buf.get_f32_le()?;
30285 __struct.yaw_rate = buf.get_f32_le()?;
30286 let tmp = buf.get_u16_le()?;
30287 __struct.type_mask =
30288 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
30289 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30290 flag_type: "PositionTargetTypemask",
30291 value: tmp as u64,
30292 })?;
30293 __struct.target_system = buf.get_u8()?;
30294 __struct.target_component = buf.get_u8()?;
30295 let tmp = buf.get_u8()?;
30296 __struct.coordinate_frame =
30297 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30298 enum_type: "MavFrame",
30299 value: tmp as u64,
30300 })?;
30301 Ok(__struct)
30302 }
30303 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30304 let mut __tmp = BytesMut::new(bytes);
30305 #[allow(clippy::absurd_extreme_comparisons)]
30306 #[allow(unused_comparisons)]
30307 if __tmp.remaining() < Self::ENCODED_LEN {
30308 panic!(
30309 "buffer is too small (need {} bytes, but got {})",
30310 Self::ENCODED_LEN,
30311 __tmp.remaining(),
30312 )
30313 }
30314 __tmp.put_u32_le(self.time_boot_ms);
30315 __tmp.put_i32_le(self.lat_int);
30316 __tmp.put_i32_le(self.lon_int);
30317 __tmp.put_f32_le(self.alt);
30318 __tmp.put_f32_le(self.vx);
30319 __tmp.put_f32_le(self.vy);
30320 __tmp.put_f32_le(self.vz);
30321 __tmp.put_f32_le(self.afx);
30322 __tmp.put_f32_le(self.afy);
30323 __tmp.put_f32_le(self.afz);
30324 __tmp.put_f32_le(self.yaw);
30325 __tmp.put_f32_le(self.yaw_rate);
30326 __tmp.put_u16_le(self.type_mask.bits() as u16);
30327 __tmp.put_u8(self.target_system);
30328 __tmp.put_u8(self.target_component);
30329 __tmp.put_u8(self.coordinate_frame as u8);
30330 if matches!(version, MavlinkVersion::V2) {
30331 let len = __tmp.len();
30332 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30333 } else {
30334 __tmp.len()
30335 }
30336 }
30337}
30338#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
30339#[doc = ""]
30340#[doc = "ID: 84"]
30341#[derive(Debug, Clone, PartialEq)]
30342#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30343#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30344#[cfg_attr(feature = "ts", derive(TS))]
30345#[cfg_attr(feature = "ts", ts(export))]
30346pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
30347 #[doc = "Timestamp (time since system boot)."]
30348 pub time_boot_ms: u32,
30349 #[doc = "X Position in NED frame"]
30350 pub x: f32,
30351 #[doc = "Y Position in NED frame"]
30352 pub y: f32,
30353 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
30354 pub z: f32,
30355 #[doc = "X velocity in NED frame"]
30356 pub vx: f32,
30357 #[doc = "Y velocity in NED frame"]
30358 pub vy: f32,
30359 #[doc = "Z velocity in NED frame"]
30360 pub vz: f32,
30361 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
30362 pub afx: f32,
30363 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
30364 pub afy: f32,
30365 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
30366 pub afz: f32,
30367 #[doc = "yaw setpoint"]
30368 pub yaw: f32,
30369 #[doc = "yaw rate setpoint"]
30370 pub yaw_rate: f32,
30371 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
30372 pub type_mask: PositionTargetTypemask,
30373 #[doc = "System ID"]
30374 pub target_system: u8,
30375 #[doc = "Component ID"]
30376 pub target_component: u8,
30377 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
30378 pub coordinate_frame: MavFrame,
30379}
30380impl SET_POSITION_TARGET_LOCAL_NED_DATA {
30381 pub const ENCODED_LEN: usize = 53usize;
30382 pub const DEFAULT: Self = Self {
30383 time_boot_ms: 0_u32,
30384 x: 0.0_f32,
30385 y: 0.0_f32,
30386 z: 0.0_f32,
30387 vx: 0.0_f32,
30388 vy: 0.0_f32,
30389 vz: 0.0_f32,
30390 afx: 0.0_f32,
30391 afy: 0.0_f32,
30392 afz: 0.0_f32,
30393 yaw: 0.0_f32,
30394 yaw_rate: 0.0_f32,
30395 type_mask: PositionTargetTypemask::DEFAULT,
30396 target_system: 0_u8,
30397 target_component: 0_u8,
30398 coordinate_frame: MavFrame::DEFAULT,
30399 };
30400 #[cfg(feature = "arbitrary")]
30401 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30402 use arbitrary::{Arbitrary, Unstructured};
30403 let mut buf = [0u8; 1024];
30404 rng.fill_bytes(&mut buf);
30405 let mut unstructured = Unstructured::new(&buf);
30406 Self::arbitrary(&mut unstructured).unwrap_or_default()
30407 }
30408}
30409impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
30410 fn default() -> Self {
30411 Self::DEFAULT.clone()
30412 }
30413}
30414impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
30415 type Message = MavMessage;
30416 const ID: u32 = 84u32;
30417 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
30418 const EXTRA_CRC: u8 = 143u8;
30419 const ENCODED_LEN: usize = 53usize;
30420 fn deser(
30421 _version: MavlinkVersion,
30422 __input: &[u8],
30423 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30424 let avail_len = __input.len();
30425 let mut payload_buf = [0; Self::ENCODED_LEN];
30426 let mut buf = if avail_len < Self::ENCODED_LEN {
30427 payload_buf[0..avail_len].copy_from_slice(__input);
30428 Bytes::new(&payload_buf)
30429 } else {
30430 Bytes::new(__input)
30431 };
30432 let mut __struct = Self::default();
30433 __struct.time_boot_ms = buf.get_u32_le()?;
30434 __struct.x = buf.get_f32_le()?;
30435 __struct.y = buf.get_f32_le()?;
30436 __struct.z = buf.get_f32_le()?;
30437 __struct.vx = buf.get_f32_le()?;
30438 __struct.vy = buf.get_f32_le()?;
30439 __struct.vz = buf.get_f32_le()?;
30440 __struct.afx = buf.get_f32_le()?;
30441 __struct.afy = buf.get_f32_le()?;
30442 __struct.afz = buf.get_f32_le()?;
30443 __struct.yaw = buf.get_f32_le()?;
30444 __struct.yaw_rate = buf.get_f32_le()?;
30445 let tmp = buf.get_u16_le()?;
30446 __struct.type_mask =
30447 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
30448 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30449 flag_type: "PositionTargetTypemask",
30450 value: tmp as u64,
30451 })?;
30452 __struct.target_system = buf.get_u8()?;
30453 __struct.target_component = buf.get_u8()?;
30454 let tmp = buf.get_u8()?;
30455 __struct.coordinate_frame =
30456 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30457 enum_type: "MavFrame",
30458 value: tmp as u64,
30459 })?;
30460 Ok(__struct)
30461 }
30462 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30463 let mut __tmp = BytesMut::new(bytes);
30464 #[allow(clippy::absurd_extreme_comparisons)]
30465 #[allow(unused_comparisons)]
30466 if __tmp.remaining() < Self::ENCODED_LEN {
30467 panic!(
30468 "buffer is too small (need {} bytes, but got {})",
30469 Self::ENCODED_LEN,
30470 __tmp.remaining(),
30471 )
30472 }
30473 __tmp.put_u32_le(self.time_boot_ms);
30474 __tmp.put_f32_le(self.x);
30475 __tmp.put_f32_le(self.y);
30476 __tmp.put_f32_le(self.z);
30477 __tmp.put_f32_le(self.vx);
30478 __tmp.put_f32_le(self.vy);
30479 __tmp.put_f32_le(self.vz);
30480 __tmp.put_f32_le(self.afx);
30481 __tmp.put_f32_le(self.afy);
30482 __tmp.put_f32_le(self.afz);
30483 __tmp.put_f32_le(self.yaw);
30484 __tmp.put_f32_le(self.yaw_rate);
30485 __tmp.put_u16_le(self.type_mask.bits() as u16);
30486 __tmp.put_u8(self.target_system);
30487 __tmp.put_u8(self.target_component);
30488 __tmp.put_u8(self.coordinate_frame as u8);
30489 if matches!(version, MavlinkVersion::V2) {
30490 let len = __tmp.len();
30491 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30492 } else {
30493 __tmp.len()
30494 }
30495 }
30496}
30497#[doc = "Status of simulation environment, if used."]
30498#[doc = ""]
30499#[doc = "ID: 108"]
30500#[derive(Debug, Clone, PartialEq)]
30501#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30502#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30503#[cfg_attr(feature = "ts", derive(TS))]
30504#[cfg_attr(feature = "ts", ts(export))]
30505pub struct SIM_STATE_DATA {
30506 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
30507 pub q1: f32,
30508 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
30509 pub q2: f32,
30510 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
30511 pub q3: f32,
30512 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
30513 pub q4: f32,
30514 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
30515 pub roll: f32,
30516 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
30517 pub pitch: f32,
30518 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
30519 pub yaw: f32,
30520 #[doc = "X acceleration"]
30521 pub xacc: f32,
30522 #[doc = "Y acceleration"]
30523 pub yacc: f32,
30524 #[doc = "Z acceleration"]
30525 pub zacc: f32,
30526 #[doc = "Angular speed around X axis"]
30527 pub xgyro: f32,
30528 #[doc = "Angular speed around Y axis"]
30529 pub ygyro: f32,
30530 #[doc = "Angular speed around Z axis"]
30531 pub zgyro: f32,
30532 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
30533 pub lat: f32,
30534 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
30535 pub lon: f32,
30536 #[doc = "Altitude"]
30537 pub alt: f32,
30538 #[doc = "Horizontal position standard deviation"]
30539 pub std_dev_horz: f32,
30540 #[doc = "Vertical position standard deviation"]
30541 pub std_dev_vert: f32,
30542 #[doc = "True velocity in north direction in earth-fixed NED frame"]
30543 pub vn: f32,
30544 #[doc = "True velocity in east direction in earth-fixed NED frame"]
30545 pub ve: f32,
30546 #[doc = "True velocity in down direction in earth-fixed NED frame"]
30547 pub vd: f32,
30548 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
30549 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30550 pub lat_int: i32,
30551 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
30552 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30553 pub lon_int: i32,
30554}
30555impl SIM_STATE_DATA {
30556 pub const ENCODED_LEN: usize = 92usize;
30557 pub const DEFAULT: Self = Self {
30558 q1: 0.0_f32,
30559 q2: 0.0_f32,
30560 q3: 0.0_f32,
30561 q4: 0.0_f32,
30562 roll: 0.0_f32,
30563 pitch: 0.0_f32,
30564 yaw: 0.0_f32,
30565 xacc: 0.0_f32,
30566 yacc: 0.0_f32,
30567 zacc: 0.0_f32,
30568 xgyro: 0.0_f32,
30569 ygyro: 0.0_f32,
30570 zgyro: 0.0_f32,
30571 lat: 0.0_f32,
30572 lon: 0.0_f32,
30573 alt: 0.0_f32,
30574 std_dev_horz: 0.0_f32,
30575 std_dev_vert: 0.0_f32,
30576 vn: 0.0_f32,
30577 ve: 0.0_f32,
30578 vd: 0.0_f32,
30579 lat_int: 0_i32,
30580 lon_int: 0_i32,
30581 };
30582 #[cfg(feature = "arbitrary")]
30583 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30584 use arbitrary::{Arbitrary, Unstructured};
30585 let mut buf = [0u8; 1024];
30586 rng.fill_bytes(&mut buf);
30587 let mut unstructured = Unstructured::new(&buf);
30588 Self::arbitrary(&mut unstructured).unwrap_or_default()
30589 }
30590}
30591impl Default for SIM_STATE_DATA {
30592 fn default() -> Self {
30593 Self::DEFAULT.clone()
30594 }
30595}
30596impl MessageData for SIM_STATE_DATA {
30597 type Message = MavMessage;
30598 const ID: u32 = 108u32;
30599 const NAME: &'static str = "SIM_STATE";
30600 const EXTRA_CRC: u8 = 32u8;
30601 const ENCODED_LEN: usize = 92usize;
30602 fn deser(
30603 _version: MavlinkVersion,
30604 __input: &[u8],
30605 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30606 let avail_len = __input.len();
30607 let mut payload_buf = [0; Self::ENCODED_LEN];
30608 let mut buf = if avail_len < Self::ENCODED_LEN {
30609 payload_buf[0..avail_len].copy_from_slice(__input);
30610 Bytes::new(&payload_buf)
30611 } else {
30612 Bytes::new(__input)
30613 };
30614 let mut __struct = Self::default();
30615 __struct.q1 = buf.get_f32_le()?;
30616 __struct.q2 = buf.get_f32_le()?;
30617 __struct.q3 = buf.get_f32_le()?;
30618 __struct.q4 = buf.get_f32_le()?;
30619 __struct.roll = buf.get_f32_le()?;
30620 __struct.pitch = buf.get_f32_le()?;
30621 __struct.yaw = buf.get_f32_le()?;
30622 __struct.xacc = buf.get_f32_le()?;
30623 __struct.yacc = buf.get_f32_le()?;
30624 __struct.zacc = buf.get_f32_le()?;
30625 __struct.xgyro = buf.get_f32_le()?;
30626 __struct.ygyro = buf.get_f32_le()?;
30627 __struct.zgyro = buf.get_f32_le()?;
30628 __struct.lat = buf.get_f32_le()?;
30629 __struct.lon = buf.get_f32_le()?;
30630 __struct.alt = buf.get_f32_le()?;
30631 __struct.std_dev_horz = buf.get_f32_le()?;
30632 __struct.std_dev_vert = buf.get_f32_le()?;
30633 __struct.vn = buf.get_f32_le()?;
30634 __struct.ve = buf.get_f32_le()?;
30635 __struct.vd = buf.get_f32_le()?;
30636 __struct.lat_int = buf.get_i32_le()?;
30637 __struct.lon_int = buf.get_i32_le()?;
30638 Ok(__struct)
30639 }
30640 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30641 let mut __tmp = BytesMut::new(bytes);
30642 #[allow(clippy::absurd_extreme_comparisons)]
30643 #[allow(unused_comparisons)]
30644 if __tmp.remaining() < Self::ENCODED_LEN {
30645 panic!(
30646 "buffer is too small (need {} bytes, but got {})",
30647 Self::ENCODED_LEN,
30648 __tmp.remaining(),
30649 )
30650 }
30651 __tmp.put_f32_le(self.q1);
30652 __tmp.put_f32_le(self.q2);
30653 __tmp.put_f32_le(self.q3);
30654 __tmp.put_f32_le(self.q4);
30655 __tmp.put_f32_le(self.roll);
30656 __tmp.put_f32_le(self.pitch);
30657 __tmp.put_f32_le(self.yaw);
30658 __tmp.put_f32_le(self.xacc);
30659 __tmp.put_f32_le(self.yacc);
30660 __tmp.put_f32_le(self.zacc);
30661 __tmp.put_f32_le(self.xgyro);
30662 __tmp.put_f32_le(self.ygyro);
30663 __tmp.put_f32_le(self.zgyro);
30664 __tmp.put_f32_le(self.lat);
30665 __tmp.put_f32_le(self.lon);
30666 __tmp.put_f32_le(self.alt);
30667 __tmp.put_f32_le(self.std_dev_horz);
30668 __tmp.put_f32_le(self.std_dev_vert);
30669 __tmp.put_f32_le(self.vn);
30670 __tmp.put_f32_le(self.ve);
30671 __tmp.put_f32_le(self.vd);
30672 if matches!(version, MavlinkVersion::V2) {
30673 __tmp.put_i32_le(self.lat_int);
30674 __tmp.put_i32_le(self.lon_int);
30675 let len = __tmp.len();
30676 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30677 } else {
30678 __tmp.len()
30679 }
30680 }
30681}
30682#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
30683#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
30684#[doc = ""]
30685#[doc = "ID: 370"]
30686#[derive(Debug, Clone, PartialEq)]
30687#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30688#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30689#[cfg_attr(feature = "ts", derive(TS))]
30690#[cfg_attr(feature = "ts", ts(export))]
30691pub struct SMART_BATTERY_INFO_DATA {
30692 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
30693 pub capacity_full_specification: i32,
30694 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
30695 pub capacity_full: i32,
30696 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
30697 pub cycle_count: u16,
30698 #[doc = "Battery weight. 0: field not provided."]
30699 pub weight: u16,
30700 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
30701 pub discharge_minimum_voltage: u16,
30702 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
30703 pub charging_minimum_voltage: u16,
30704 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
30705 pub resting_minimum_voltage: u16,
30706 #[doc = "Battery ID"]
30707 pub id: u8,
30708 #[doc = "Function of the battery"]
30709 pub battery_function: MavBatteryFunction,
30710 #[doc = "Type (chemistry) of the battery"]
30711 pub mavtype: MavBatteryType,
30712 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
30713 #[cfg_attr(feature = "ts", ts(type = "string"))]
30714 pub serial_number: CharArray<16>,
30715 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
30716 #[cfg_attr(feature = "ts", ts(type = "string"))]
30717 pub device_name: CharArray<50>,
30718 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
30719 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30720 pub charging_maximum_voltage: u16,
30721 #[doc = "Number of battery cells in series. 0: field not provided."]
30722 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30723 pub cells_in_series: u8,
30724 #[doc = "Maximum pack discharge current. 0: field not provided."]
30725 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30726 pub discharge_maximum_current: u32,
30727 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
30728 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30729 pub discharge_maximum_burst_current: u32,
30730 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
30731 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30732 #[cfg_attr(feature = "ts", ts(type = "string"))]
30733 pub manufacture_date: CharArray<11>,
30734}
30735impl SMART_BATTERY_INFO_DATA {
30736 pub const ENCODED_LEN: usize = 109usize;
30737 pub const DEFAULT: Self = Self {
30738 capacity_full_specification: 0_i32,
30739 capacity_full: 0_i32,
30740 cycle_count: 0_u16,
30741 weight: 0_u16,
30742 discharge_minimum_voltage: 0_u16,
30743 charging_minimum_voltage: 0_u16,
30744 resting_minimum_voltage: 0_u16,
30745 id: 0_u8,
30746 battery_function: MavBatteryFunction::DEFAULT,
30747 mavtype: MavBatteryType::DEFAULT,
30748 serial_number: CharArray::new([0_u8; 16usize]),
30749 device_name: CharArray::new([0_u8; 50usize]),
30750 charging_maximum_voltage: 0_u16,
30751 cells_in_series: 0_u8,
30752 discharge_maximum_current: 0_u32,
30753 discharge_maximum_burst_current: 0_u32,
30754 manufacture_date: CharArray::new([0_u8; 11usize]),
30755 };
30756 #[cfg(feature = "arbitrary")]
30757 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30758 use arbitrary::{Arbitrary, Unstructured};
30759 let mut buf = [0u8; 1024];
30760 rng.fill_bytes(&mut buf);
30761 let mut unstructured = Unstructured::new(&buf);
30762 Self::arbitrary(&mut unstructured).unwrap_or_default()
30763 }
30764}
30765impl Default for SMART_BATTERY_INFO_DATA {
30766 fn default() -> Self {
30767 Self::DEFAULT.clone()
30768 }
30769}
30770impl MessageData for SMART_BATTERY_INFO_DATA {
30771 type Message = MavMessage;
30772 const ID: u32 = 370u32;
30773 const NAME: &'static str = "SMART_BATTERY_INFO";
30774 const EXTRA_CRC: u8 = 75u8;
30775 const ENCODED_LEN: usize = 109usize;
30776 fn deser(
30777 _version: MavlinkVersion,
30778 __input: &[u8],
30779 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30780 let avail_len = __input.len();
30781 let mut payload_buf = [0; Self::ENCODED_LEN];
30782 let mut buf = if avail_len < Self::ENCODED_LEN {
30783 payload_buf[0..avail_len].copy_from_slice(__input);
30784 Bytes::new(&payload_buf)
30785 } else {
30786 Bytes::new(__input)
30787 };
30788 let mut __struct = Self::default();
30789 __struct.capacity_full_specification = buf.get_i32_le()?;
30790 __struct.capacity_full = buf.get_i32_le()?;
30791 __struct.cycle_count = buf.get_u16_le()?;
30792 __struct.weight = buf.get_u16_le()?;
30793 __struct.discharge_minimum_voltage = buf.get_u16_le()?;
30794 __struct.charging_minimum_voltage = buf.get_u16_le()?;
30795 __struct.resting_minimum_voltage = buf.get_u16_le()?;
30796 __struct.id = buf.get_u8()?;
30797 let tmp = buf.get_u8()?;
30798 __struct.battery_function =
30799 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30800 enum_type: "MavBatteryFunction",
30801 value: tmp as u64,
30802 })?;
30803 let tmp = buf.get_u8()?;
30804 __struct.mavtype =
30805 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30806 enum_type: "MavBatteryType",
30807 value: tmp as u64,
30808 })?;
30809 let mut tmp = [0_u8; 16usize];
30810 for v in &mut tmp {
30811 *v = buf.get_u8()?;
30812 }
30813 __struct.serial_number = CharArray::new(tmp);
30814 let mut tmp = [0_u8; 50usize];
30815 for v in &mut tmp {
30816 *v = buf.get_u8()?;
30817 }
30818 __struct.device_name = CharArray::new(tmp);
30819 __struct.charging_maximum_voltage = buf.get_u16_le()?;
30820 __struct.cells_in_series = buf.get_u8()?;
30821 __struct.discharge_maximum_current = buf.get_u32_le()?;
30822 __struct.discharge_maximum_burst_current = buf.get_u32_le()?;
30823 let mut tmp = [0_u8; 11usize];
30824 for v in &mut tmp {
30825 *v = buf.get_u8()?;
30826 }
30827 __struct.manufacture_date = CharArray::new(tmp);
30828 Ok(__struct)
30829 }
30830 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30831 let mut __tmp = BytesMut::new(bytes);
30832 #[allow(clippy::absurd_extreme_comparisons)]
30833 #[allow(unused_comparisons)]
30834 if __tmp.remaining() < Self::ENCODED_LEN {
30835 panic!(
30836 "buffer is too small (need {} bytes, but got {})",
30837 Self::ENCODED_LEN,
30838 __tmp.remaining(),
30839 )
30840 }
30841 __tmp.put_i32_le(self.capacity_full_specification);
30842 __tmp.put_i32_le(self.capacity_full);
30843 __tmp.put_u16_le(self.cycle_count);
30844 __tmp.put_u16_le(self.weight);
30845 __tmp.put_u16_le(self.discharge_minimum_voltage);
30846 __tmp.put_u16_le(self.charging_minimum_voltage);
30847 __tmp.put_u16_le(self.resting_minimum_voltage);
30848 __tmp.put_u8(self.id);
30849 __tmp.put_u8(self.battery_function as u8);
30850 __tmp.put_u8(self.mavtype as u8);
30851 for val in &self.serial_number {
30852 __tmp.put_u8(*val);
30853 }
30854 for val in &self.device_name {
30855 __tmp.put_u8(*val);
30856 }
30857 if matches!(version, MavlinkVersion::V2) {
30858 __tmp.put_u16_le(self.charging_maximum_voltage);
30859 __tmp.put_u8(self.cells_in_series);
30860 __tmp.put_u32_le(self.discharge_maximum_current);
30861 __tmp.put_u32_le(self.discharge_maximum_burst_current);
30862 for val in &self.manufacture_date {
30863 __tmp.put_u8(*val);
30864 }
30865 let len = __tmp.len();
30866 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30867 } else {
30868 __tmp.len()
30869 }
30870 }
30871}
30872#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
30873#[doc = ""]
30874#[doc = "ID: 253"]
30875#[derive(Debug, Clone, PartialEq)]
30876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30877#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30878#[cfg_attr(feature = "ts", derive(TS))]
30879#[cfg_attr(feature = "ts", ts(export))]
30880pub struct STATUSTEXT_DATA {
30881 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
30882 pub severity: MavSeverity,
30883 #[doc = "Status text message, without null termination character"]
30884 #[cfg_attr(feature = "ts", ts(type = "string"))]
30885 pub text: CharArray<50>,
30886 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
30887 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30888 pub id: u16,
30889 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
30890 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30891 pub chunk_seq: u8,
30892}
30893impl STATUSTEXT_DATA {
30894 pub const ENCODED_LEN: usize = 54usize;
30895 pub const DEFAULT: Self = Self {
30896 severity: MavSeverity::DEFAULT,
30897 text: CharArray::new([0_u8; 50usize]),
30898 id: 0_u16,
30899 chunk_seq: 0_u8,
30900 };
30901 #[cfg(feature = "arbitrary")]
30902 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30903 use arbitrary::{Arbitrary, Unstructured};
30904 let mut buf = [0u8; 1024];
30905 rng.fill_bytes(&mut buf);
30906 let mut unstructured = Unstructured::new(&buf);
30907 Self::arbitrary(&mut unstructured).unwrap_or_default()
30908 }
30909}
30910impl Default for STATUSTEXT_DATA {
30911 fn default() -> Self {
30912 Self::DEFAULT.clone()
30913 }
30914}
30915impl MessageData for STATUSTEXT_DATA {
30916 type Message = MavMessage;
30917 const ID: u32 = 253u32;
30918 const NAME: &'static str = "STATUSTEXT";
30919 const EXTRA_CRC: u8 = 83u8;
30920 const ENCODED_LEN: usize = 54usize;
30921 fn deser(
30922 _version: MavlinkVersion,
30923 __input: &[u8],
30924 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30925 let avail_len = __input.len();
30926 let mut payload_buf = [0; Self::ENCODED_LEN];
30927 let mut buf = if avail_len < Self::ENCODED_LEN {
30928 payload_buf[0..avail_len].copy_from_slice(__input);
30929 Bytes::new(&payload_buf)
30930 } else {
30931 Bytes::new(__input)
30932 };
30933 let mut __struct = Self::default();
30934 let tmp = buf.get_u8()?;
30935 __struct.severity =
30936 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30937 enum_type: "MavSeverity",
30938 value: tmp as u64,
30939 })?;
30940 let mut tmp = [0_u8; 50usize];
30941 for v in &mut tmp {
30942 *v = buf.get_u8()?;
30943 }
30944 __struct.text = CharArray::new(tmp);
30945 __struct.id = buf.get_u16_le()?;
30946 __struct.chunk_seq = buf.get_u8()?;
30947 Ok(__struct)
30948 }
30949 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30950 let mut __tmp = BytesMut::new(bytes);
30951 #[allow(clippy::absurd_extreme_comparisons)]
30952 #[allow(unused_comparisons)]
30953 if __tmp.remaining() < Self::ENCODED_LEN {
30954 panic!(
30955 "buffer is too small (need {} bytes, but got {})",
30956 Self::ENCODED_LEN,
30957 __tmp.remaining(),
30958 )
30959 }
30960 __tmp.put_u8(self.severity as u8);
30961 for val in &self.text {
30962 __tmp.put_u8(*val);
30963 }
30964 if matches!(version, MavlinkVersion::V2) {
30965 __tmp.put_u16_le(self.id);
30966 __tmp.put_u8(self.chunk_seq);
30967 let len = __tmp.len();
30968 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30969 } else {
30970 __tmp.len()
30971 }
30972 }
30973}
30974#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
30975#[doc = ""]
30976#[doc = "ID: 261"]
30977#[derive(Debug, Clone, PartialEq)]
30978#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30979#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30980#[cfg_attr(feature = "ts", derive(TS))]
30981#[cfg_attr(feature = "ts", ts(export))]
30982pub struct STORAGE_INFORMATION_DATA {
30983 #[doc = "Timestamp (time since system boot)."]
30984 pub time_boot_ms: u32,
30985 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
30986 pub total_capacity: f32,
30987 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
30988 pub used_capacity: f32,
30989 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
30990 pub available_capacity: f32,
30991 #[doc = "Read speed."]
30992 pub read_speed: f32,
30993 #[doc = "Write speed."]
30994 pub write_speed: f32,
30995 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
30996 pub storage_id: u8,
30997 #[doc = "Number of storage devices"]
30998 pub storage_count: u8,
30999 #[doc = "Status of storage"]
31000 pub status: StorageStatus,
31001 #[doc = "Type of storage"]
31002 #[cfg_attr(feature = "serde", serde(default))]
31003 pub mavtype: StorageType,
31004 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
31005 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31006 #[cfg_attr(feature = "ts", ts(type = "string"))]
31007 pub name: CharArray<32>,
31008 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
31009 #[cfg_attr(feature = "serde", serde(default))]
31010 pub storage_usage: StorageUsageFlag,
31011}
31012impl STORAGE_INFORMATION_DATA {
31013 pub const ENCODED_LEN: usize = 61usize;
31014 pub const DEFAULT: Self = Self {
31015 time_boot_ms: 0_u32,
31016 total_capacity: 0.0_f32,
31017 used_capacity: 0.0_f32,
31018 available_capacity: 0.0_f32,
31019 read_speed: 0.0_f32,
31020 write_speed: 0.0_f32,
31021 storage_id: 0_u8,
31022 storage_count: 0_u8,
31023 status: StorageStatus::DEFAULT,
31024 mavtype: StorageType::DEFAULT,
31025 name: CharArray::new([0_u8; 32usize]),
31026 storage_usage: StorageUsageFlag::DEFAULT,
31027 };
31028 #[cfg(feature = "arbitrary")]
31029 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31030 use arbitrary::{Arbitrary, Unstructured};
31031 let mut buf = [0u8; 1024];
31032 rng.fill_bytes(&mut buf);
31033 let mut unstructured = Unstructured::new(&buf);
31034 Self::arbitrary(&mut unstructured).unwrap_or_default()
31035 }
31036}
31037impl Default for STORAGE_INFORMATION_DATA {
31038 fn default() -> Self {
31039 Self::DEFAULT.clone()
31040 }
31041}
31042impl MessageData for STORAGE_INFORMATION_DATA {
31043 type Message = MavMessage;
31044 const ID: u32 = 261u32;
31045 const NAME: &'static str = "STORAGE_INFORMATION";
31046 const EXTRA_CRC: u8 = 179u8;
31047 const ENCODED_LEN: usize = 61usize;
31048 fn deser(
31049 _version: MavlinkVersion,
31050 __input: &[u8],
31051 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31052 let avail_len = __input.len();
31053 let mut payload_buf = [0; Self::ENCODED_LEN];
31054 let mut buf = if avail_len < Self::ENCODED_LEN {
31055 payload_buf[0..avail_len].copy_from_slice(__input);
31056 Bytes::new(&payload_buf)
31057 } else {
31058 Bytes::new(__input)
31059 };
31060 let mut __struct = Self::default();
31061 __struct.time_boot_ms = buf.get_u32_le()?;
31062 __struct.total_capacity = buf.get_f32_le()?;
31063 __struct.used_capacity = buf.get_f32_le()?;
31064 __struct.available_capacity = buf.get_f32_le()?;
31065 __struct.read_speed = buf.get_f32_le()?;
31066 __struct.write_speed = buf.get_f32_le()?;
31067 __struct.storage_id = buf.get_u8()?;
31068 __struct.storage_count = buf.get_u8()?;
31069 let tmp = buf.get_u8()?;
31070 __struct.status =
31071 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31072 enum_type: "StorageStatus",
31073 value: tmp as u64,
31074 })?;
31075 let tmp = buf.get_u8()?;
31076 __struct.mavtype =
31077 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31078 enum_type: "StorageType",
31079 value: tmp as u64,
31080 })?;
31081 let mut tmp = [0_u8; 32usize];
31082 for v in &mut tmp {
31083 *v = buf.get_u8()?;
31084 }
31085 __struct.name = CharArray::new(tmp);
31086 let tmp = buf.get_u8()?;
31087 __struct.storage_usage = StorageUsageFlag::from_bits(
31088 tmp as <StorageUsageFlag as Flags>::Bits,
31089 )
31090 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31091 flag_type: "StorageUsageFlag",
31092 value: tmp as u64,
31093 })?;
31094 Ok(__struct)
31095 }
31096 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31097 let mut __tmp = BytesMut::new(bytes);
31098 #[allow(clippy::absurd_extreme_comparisons)]
31099 #[allow(unused_comparisons)]
31100 if __tmp.remaining() < Self::ENCODED_LEN {
31101 panic!(
31102 "buffer is too small (need {} bytes, but got {})",
31103 Self::ENCODED_LEN,
31104 __tmp.remaining(),
31105 )
31106 }
31107 __tmp.put_u32_le(self.time_boot_ms);
31108 __tmp.put_f32_le(self.total_capacity);
31109 __tmp.put_f32_le(self.used_capacity);
31110 __tmp.put_f32_le(self.available_capacity);
31111 __tmp.put_f32_le(self.read_speed);
31112 __tmp.put_f32_le(self.write_speed);
31113 __tmp.put_u8(self.storage_id);
31114 __tmp.put_u8(self.storage_count);
31115 __tmp.put_u8(self.status as u8);
31116 if matches!(version, MavlinkVersion::V2) {
31117 __tmp.put_u8(self.mavtype as u8);
31118 for val in &self.name {
31119 __tmp.put_u8(*val);
31120 }
31121 __tmp.put_u8(self.storage_usage.bits() as u8);
31122 let len = __tmp.len();
31123 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31124 } else {
31125 __tmp.len()
31126 }
31127 }
31128}
31129#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
31130#[doc = ""]
31131#[doc = "ID: 401"]
31132#[derive(Debug, Clone, PartialEq)]
31133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31135#[cfg_attr(feature = "ts", derive(TS))]
31136#[cfg_attr(feature = "ts", ts(export))]
31137pub struct SUPPORTED_TUNES_DATA {
31138 #[doc = "Bitfield of supported tune formats."]
31139 pub format: TuneFormat,
31140 #[doc = "System ID"]
31141 pub target_system: u8,
31142 #[doc = "Component ID"]
31143 pub target_component: u8,
31144}
31145impl SUPPORTED_TUNES_DATA {
31146 pub const ENCODED_LEN: usize = 6usize;
31147 pub const DEFAULT: Self = Self {
31148 format: TuneFormat::DEFAULT,
31149 target_system: 0_u8,
31150 target_component: 0_u8,
31151 };
31152 #[cfg(feature = "arbitrary")]
31153 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31154 use arbitrary::{Arbitrary, Unstructured};
31155 let mut buf = [0u8; 1024];
31156 rng.fill_bytes(&mut buf);
31157 let mut unstructured = Unstructured::new(&buf);
31158 Self::arbitrary(&mut unstructured).unwrap_or_default()
31159 }
31160}
31161impl Default for SUPPORTED_TUNES_DATA {
31162 fn default() -> Self {
31163 Self::DEFAULT.clone()
31164 }
31165}
31166impl MessageData for SUPPORTED_TUNES_DATA {
31167 type Message = MavMessage;
31168 const ID: u32 = 401u32;
31169 const NAME: &'static str = "SUPPORTED_TUNES";
31170 const EXTRA_CRC: u8 = 183u8;
31171 const ENCODED_LEN: usize = 6usize;
31172 fn deser(
31173 _version: MavlinkVersion,
31174 __input: &[u8],
31175 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31176 let avail_len = __input.len();
31177 let mut payload_buf = [0; Self::ENCODED_LEN];
31178 let mut buf = if avail_len < Self::ENCODED_LEN {
31179 payload_buf[0..avail_len].copy_from_slice(__input);
31180 Bytes::new(&payload_buf)
31181 } else {
31182 Bytes::new(__input)
31183 };
31184 let mut __struct = Self::default();
31185 let tmp = buf.get_u32_le()?;
31186 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
31187 ::mavlink_core::error::ParserError::InvalidEnum {
31188 enum_type: "TuneFormat",
31189 value: tmp as u64,
31190 },
31191 )?;
31192 __struct.target_system = buf.get_u8()?;
31193 __struct.target_component = buf.get_u8()?;
31194 Ok(__struct)
31195 }
31196 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31197 let mut __tmp = BytesMut::new(bytes);
31198 #[allow(clippy::absurd_extreme_comparisons)]
31199 #[allow(unused_comparisons)]
31200 if __tmp.remaining() < Self::ENCODED_LEN {
31201 panic!(
31202 "buffer is too small (need {} bytes, but got {})",
31203 Self::ENCODED_LEN,
31204 __tmp.remaining(),
31205 )
31206 }
31207 __tmp.put_u32_le(self.format as u32);
31208 __tmp.put_u8(self.target_system);
31209 __tmp.put_u8(self.target_component);
31210 if matches!(version, MavlinkVersion::V2) {
31211 let len = __tmp.len();
31212 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31213 } else {
31214 __tmp.len()
31215 }
31216 }
31217}
31218#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
31219#[doc = ""]
31220#[doc = "ID: 2"]
31221#[derive(Debug, Clone, PartialEq)]
31222#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31223#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31224#[cfg_attr(feature = "ts", derive(TS))]
31225#[cfg_attr(feature = "ts", ts(export))]
31226pub struct SYSTEM_TIME_DATA {
31227 #[doc = "Timestamp (UNIX epoch time)."]
31228 pub time_unix_usec: u64,
31229 #[doc = "Timestamp (time since system boot)."]
31230 pub time_boot_ms: u32,
31231}
31232impl SYSTEM_TIME_DATA {
31233 pub const ENCODED_LEN: usize = 12usize;
31234 pub const DEFAULT: Self = Self {
31235 time_unix_usec: 0_u64,
31236 time_boot_ms: 0_u32,
31237 };
31238 #[cfg(feature = "arbitrary")]
31239 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31240 use arbitrary::{Arbitrary, Unstructured};
31241 let mut buf = [0u8; 1024];
31242 rng.fill_bytes(&mut buf);
31243 let mut unstructured = Unstructured::new(&buf);
31244 Self::arbitrary(&mut unstructured).unwrap_or_default()
31245 }
31246}
31247impl Default for SYSTEM_TIME_DATA {
31248 fn default() -> Self {
31249 Self::DEFAULT.clone()
31250 }
31251}
31252impl MessageData for SYSTEM_TIME_DATA {
31253 type Message = MavMessage;
31254 const ID: u32 = 2u32;
31255 const NAME: &'static str = "SYSTEM_TIME";
31256 const EXTRA_CRC: u8 = 137u8;
31257 const ENCODED_LEN: usize = 12usize;
31258 fn deser(
31259 _version: MavlinkVersion,
31260 __input: &[u8],
31261 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31262 let avail_len = __input.len();
31263 let mut payload_buf = [0; Self::ENCODED_LEN];
31264 let mut buf = if avail_len < Self::ENCODED_LEN {
31265 payload_buf[0..avail_len].copy_from_slice(__input);
31266 Bytes::new(&payload_buf)
31267 } else {
31268 Bytes::new(__input)
31269 };
31270 let mut __struct = Self::default();
31271 __struct.time_unix_usec = buf.get_u64_le()?;
31272 __struct.time_boot_ms = buf.get_u32_le()?;
31273 Ok(__struct)
31274 }
31275 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31276 let mut __tmp = BytesMut::new(bytes);
31277 #[allow(clippy::absurd_extreme_comparisons)]
31278 #[allow(unused_comparisons)]
31279 if __tmp.remaining() < Self::ENCODED_LEN {
31280 panic!(
31281 "buffer is too small (need {} bytes, but got {})",
31282 Self::ENCODED_LEN,
31283 __tmp.remaining(),
31284 )
31285 }
31286 __tmp.put_u64_le(self.time_unix_usec);
31287 __tmp.put_u32_le(self.time_boot_ms);
31288 if matches!(version, MavlinkVersion::V2) {
31289 let len = __tmp.len();
31290 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31291 } else {
31292 __tmp.len()
31293 }
31294 }
31295}
31296#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
31297#[doc = ""]
31298#[doc = "ID: 1"]
31299#[derive(Debug, Clone, PartialEq)]
31300#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31301#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31302#[cfg_attr(feature = "ts", derive(TS))]
31303#[cfg_attr(feature = "ts", ts(export))]
31304pub struct SYS_STATUS_DATA {
31305 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
31306 pub onboard_control_sensors_present: MavSysStatusSensor,
31307 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
31308 pub onboard_control_sensors_enabled: MavSysStatusSensor,
31309 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
31310 pub onboard_control_sensors_health: MavSysStatusSensor,
31311 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
31312 pub load: u16,
31313 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
31314 pub voltage_battery: u16,
31315 #[doc = "Battery current, -1: Current not sent by autopilot"]
31316 pub current_battery: i16,
31317 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
31318 pub drop_rate_comm: u16,
31319 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
31320 pub errors_comm: u16,
31321 #[doc = "Autopilot-specific errors"]
31322 pub errors_count1: u16,
31323 #[doc = "Autopilot-specific errors"]
31324 pub errors_count2: u16,
31325 #[doc = "Autopilot-specific errors"]
31326 pub errors_count3: u16,
31327 #[doc = "Autopilot-specific errors"]
31328 pub errors_count4: u16,
31329 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
31330 pub battery_remaining: i8,
31331 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
31332 #[cfg_attr(feature = "serde", serde(default))]
31333 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
31334 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
31335 #[cfg_attr(feature = "serde", serde(default))]
31336 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
31337 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
31338 #[cfg_attr(feature = "serde", serde(default))]
31339 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
31340}
31341impl SYS_STATUS_DATA {
31342 pub const ENCODED_LEN: usize = 43usize;
31343 pub const DEFAULT: Self = Self {
31344 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
31345 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
31346 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
31347 load: 0_u16,
31348 voltage_battery: 0_u16,
31349 current_battery: 0_i16,
31350 drop_rate_comm: 0_u16,
31351 errors_comm: 0_u16,
31352 errors_count1: 0_u16,
31353 errors_count2: 0_u16,
31354 errors_count3: 0_u16,
31355 errors_count4: 0_u16,
31356 battery_remaining: 0_i8,
31357 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
31358 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
31359 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
31360 };
31361 #[cfg(feature = "arbitrary")]
31362 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31363 use arbitrary::{Arbitrary, Unstructured};
31364 let mut buf = [0u8; 1024];
31365 rng.fill_bytes(&mut buf);
31366 let mut unstructured = Unstructured::new(&buf);
31367 Self::arbitrary(&mut unstructured).unwrap_or_default()
31368 }
31369}
31370impl Default for SYS_STATUS_DATA {
31371 fn default() -> Self {
31372 Self::DEFAULT.clone()
31373 }
31374}
31375impl MessageData for SYS_STATUS_DATA {
31376 type Message = MavMessage;
31377 const ID: u32 = 1u32;
31378 const NAME: &'static str = "SYS_STATUS";
31379 const EXTRA_CRC: u8 = 124u8;
31380 const ENCODED_LEN: usize = 43usize;
31381 fn deser(
31382 _version: MavlinkVersion,
31383 __input: &[u8],
31384 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31385 let avail_len = __input.len();
31386 let mut payload_buf = [0; Self::ENCODED_LEN];
31387 let mut buf = if avail_len < Self::ENCODED_LEN {
31388 payload_buf[0..avail_len].copy_from_slice(__input);
31389 Bytes::new(&payload_buf)
31390 } else {
31391 Bytes::new(__input)
31392 };
31393 let mut __struct = Self::default();
31394 let tmp = buf.get_u32_le()?;
31395 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
31396 tmp as <MavSysStatusSensor as Flags>::Bits,
31397 )
31398 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31399 flag_type: "MavSysStatusSensor",
31400 value: tmp as u64,
31401 })?;
31402 let tmp = buf.get_u32_le()?;
31403 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
31404 tmp as <MavSysStatusSensor as Flags>::Bits,
31405 )
31406 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31407 flag_type: "MavSysStatusSensor",
31408 value: tmp as u64,
31409 })?;
31410 let tmp = buf.get_u32_le()?;
31411 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
31412 tmp as <MavSysStatusSensor as Flags>::Bits,
31413 )
31414 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31415 flag_type: "MavSysStatusSensor",
31416 value: tmp as u64,
31417 })?;
31418 __struct.load = buf.get_u16_le()?;
31419 __struct.voltage_battery = buf.get_u16_le()?;
31420 __struct.current_battery = buf.get_i16_le()?;
31421 __struct.drop_rate_comm = buf.get_u16_le()?;
31422 __struct.errors_comm = buf.get_u16_le()?;
31423 __struct.errors_count1 = buf.get_u16_le()?;
31424 __struct.errors_count2 = buf.get_u16_le()?;
31425 __struct.errors_count3 = buf.get_u16_le()?;
31426 __struct.errors_count4 = buf.get_u16_le()?;
31427 __struct.battery_remaining = buf.get_i8()?;
31428 let tmp = buf.get_u32_le()?;
31429 __struct.onboard_control_sensors_present_extended = MavSysStatusSensorExtended::from_bits(
31430 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
31431 )
31432 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31433 flag_type: "MavSysStatusSensorExtended",
31434 value: tmp as u64,
31435 })?;
31436 let tmp = buf.get_u32_le()?;
31437 __struct.onboard_control_sensors_enabled_extended = MavSysStatusSensorExtended::from_bits(
31438 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
31439 )
31440 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31441 flag_type: "MavSysStatusSensorExtended",
31442 value: tmp as u64,
31443 })?;
31444 let tmp = buf.get_u32_le()?;
31445 __struct.onboard_control_sensors_health_extended = MavSysStatusSensorExtended::from_bits(
31446 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
31447 )
31448 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31449 flag_type: "MavSysStatusSensorExtended",
31450 value: tmp as u64,
31451 })?;
31452 Ok(__struct)
31453 }
31454 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31455 let mut __tmp = BytesMut::new(bytes);
31456 #[allow(clippy::absurd_extreme_comparisons)]
31457 #[allow(unused_comparisons)]
31458 if __tmp.remaining() < Self::ENCODED_LEN {
31459 panic!(
31460 "buffer is too small (need {} bytes, but got {})",
31461 Self::ENCODED_LEN,
31462 __tmp.remaining(),
31463 )
31464 }
31465 __tmp.put_u32_le(self.onboard_control_sensors_present.bits() as u32);
31466 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits() as u32);
31467 __tmp.put_u32_le(self.onboard_control_sensors_health.bits() as u32);
31468 __tmp.put_u16_le(self.load);
31469 __tmp.put_u16_le(self.voltage_battery);
31470 __tmp.put_i16_le(self.current_battery);
31471 __tmp.put_u16_le(self.drop_rate_comm);
31472 __tmp.put_u16_le(self.errors_comm);
31473 __tmp.put_u16_le(self.errors_count1);
31474 __tmp.put_u16_le(self.errors_count2);
31475 __tmp.put_u16_le(self.errors_count3);
31476 __tmp.put_u16_le(self.errors_count4);
31477 __tmp.put_i8(self.battery_remaining);
31478 if matches!(version, MavlinkVersion::V2) {
31479 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits() as u32);
31480 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits() as u32);
31481 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits() as u32);
31482 let len = __tmp.len();
31483 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31484 } else {
31485 __tmp.len()
31486 }
31487 }
31488}
31489#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
31490#[doc = ""]
31491#[doc = "ID: 135"]
31492#[derive(Debug, Clone, PartialEq)]
31493#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31494#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31495#[cfg_attr(feature = "ts", derive(TS))]
31496#[cfg_attr(feature = "ts", ts(export))]
31497pub struct TERRAIN_CHECK_DATA {
31498 #[doc = "Latitude"]
31499 pub lat: i32,
31500 #[doc = "Longitude"]
31501 pub lon: i32,
31502}
31503impl TERRAIN_CHECK_DATA {
31504 pub const ENCODED_LEN: usize = 8usize;
31505 pub const DEFAULT: Self = Self {
31506 lat: 0_i32,
31507 lon: 0_i32,
31508 };
31509 #[cfg(feature = "arbitrary")]
31510 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31511 use arbitrary::{Arbitrary, Unstructured};
31512 let mut buf = [0u8; 1024];
31513 rng.fill_bytes(&mut buf);
31514 let mut unstructured = Unstructured::new(&buf);
31515 Self::arbitrary(&mut unstructured).unwrap_or_default()
31516 }
31517}
31518impl Default for TERRAIN_CHECK_DATA {
31519 fn default() -> Self {
31520 Self::DEFAULT.clone()
31521 }
31522}
31523impl MessageData for TERRAIN_CHECK_DATA {
31524 type Message = MavMessage;
31525 const ID: u32 = 135u32;
31526 const NAME: &'static str = "TERRAIN_CHECK";
31527 const EXTRA_CRC: u8 = 203u8;
31528 const ENCODED_LEN: usize = 8usize;
31529 fn deser(
31530 _version: MavlinkVersion,
31531 __input: &[u8],
31532 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31533 let avail_len = __input.len();
31534 let mut payload_buf = [0; Self::ENCODED_LEN];
31535 let mut buf = if avail_len < Self::ENCODED_LEN {
31536 payload_buf[0..avail_len].copy_from_slice(__input);
31537 Bytes::new(&payload_buf)
31538 } else {
31539 Bytes::new(__input)
31540 };
31541 let mut __struct = Self::default();
31542 __struct.lat = buf.get_i32_le()?;
31543 __struct.lon = buf.get_i32_le()?;
31544 Ok(__struct)
31545 }
31546 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31547 let mut __tmp = BytesMut::new(bytes);
31548 #[allow(clippy::absurd_extreme_comparisons)]
31549 #[allow(unused_comparisons)]
31550 if __tmp.remaining() < Self::ENCODED_LEN {
31551 panic!(
31552 "buffer is too small (need {} bytes, but got {})",
31553 Self::ENCODED_LEN,
31554 __tmp.remaining(),
31555 )
31556 }
31557 __tmp.put_i32_le(self.lat);
31558 __tmp.put_i32_le(self.lon);
31559 if matches!(version, MavlinkVersion::V2) {
31560 let len = __tmp.len();
31561 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31562 } else {
31563 __tmp.len()
31564 }
31565 }
31566}
31567#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
31568#[doc = ""]
31569#[doc = "ID: 134"]
31570#[derive(Debug, Clone, PartialEq)]
31571#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31572#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31573#[cfg_attr(feature = "ts", derive(TS))]
31574#[cfg_attr(feature = "ts", ts(export))]
31575pub struct TERRAIN_DATA_DATA {
31576 #[doc = "Latitude of SW corner of first grid"]
31577 pub lat: i32,
31578 #[doc = "Longitude of SW corner of first grid"]
31579 pub lon: i32,
31580 #[doc = "Grid spacing"]
31581 pub grid_spacing: u16,
31582 #[doc = "Terrain data MSL"]
31583 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31584 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31585 pub data: [i16; 16],
31586 #[doc = "bit within the terrain request mask"]
31587 pub gridbit: u8,
31588}
31589impl TERRAIN_DATA_DATA {
31590 pub const ENCODED_LEN: usize = 43usize;
31591 pub const DEFAULT: Self = Self {
31592 lat: 0_i32,
31593 lon: 0_i32,
31594 grid_spacing: 0_u16,
31595 data: [0_i16; 16usize],
31596 gridbit: 0_u8,
31597 };
31598 #[cfg(feature = "arbitrary")]
31599 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31600 use arbitrary::{Arbitrary, Unstructured};
31601 let mut buf = [0u8; 1024];
31602 rng.fill_bytes(&mut buf);
31603 let mut unstructured = Unstructured::new(&buf);
31604 Self::arbitrary(&mut unstructured).unwrap_or_default()
31605 }
31606}
31607impl Default for TERRAIN_DATA_DATA {
31608 fn default() -> Self {
31609 Self::DEFAULT.clone()
31610 }
31611}
31612impl MessageData for TERRAIN_DATA_DATA {
31613 type Message = MavMessage;
31614 const ID: u32 = 134u32;
31615 const NAME: &'static str = "TERRAIN_DATA";
31616 const EXTRA_CRC: u8 = 229u8;
31617 const ENCODED_LEN: usize = 43usize;
31618 fn deser(
31619 _version: MavlinkVersion,
31620 __input: &[u8],
31621 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31622 let avail_len = __input.len();
31623 let mut payload_buf = [0; Self::ENCODED_LEN];
31624 let mut buf = if avail_len < Self::ENCODED_LEN {
31625 payload_buf[0..avail_len].copy_from_slice(__input);
31626 Bytes::new(&payload_buf)
31627 } else {
31628 Bytes::new(__input)
31629 };
31630 let mut __struct = Self::default();
31631 __struct.lat = buf.get_i32_le()?;
31632 __struct.lon = buf.get_i32_le()?;
31633 __struct.grid_spacing = buf.get_u16_le()?;
31634 for v in &mut __struct.data {
31635 let val = buf.get_i16_le()?;
31636 *v = val;
31637 }
31638 __struct.gridbit = buf.get_u8()?;
31639 Ok(__struct)
31640 }
31641 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31642 let mut __tmp = BytesMut::new(bytes);
31643 #[allow(clippy::absurd_extreme_comparisons)]
31644 #[allow(unused_comparisons)]
31645 if __tmp.remaining() < Self::ENCODED_LEN {
31646 panic!(
31647 "buffer is too small (need {} bytes, but got {})",
31648 Self::ENCODED_LEN,
31649 __tmp.remaining(),
31650 )
31651 }
31652 __tmp.put_i32_le(self.lat);
31653 __tmp.put_i32_le(self.lon);
31654 __tmp.put_u16_le(self.grid_spacing);
31655 for val in &self.data {
31656 __tmp.put_i16_le(*val);
31657 }
31658 __tmp.put_u8(self.gridbit);
31659 if matches!(version, MavlinkVersion::V2) {
31660 let len = __tmp.len();
31661 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31662 } else {
31663 __tmp.len()
31664 }
31665 }
31666}
31667#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
31668#[doc = ""]
31669#[doc = "ID: 136"]
31670#[derive(Debug, Clone, PartialEq)]
31671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31672#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31673#[cfg_attr(feature = "ts", derive(TS))]
31674#[cfg_attr(feature = "ts", ts(export))]
31675pub struct TERRAIN_REPORT_DATA {
31676 #[doc = "Latitude"]
31677 pub lat: i32,
31678 #[doc = "Longitude"]
31679 pub lon: i32,
31680 #[doc = "Terrain height MSL"]
31681 pub terrain_height: f32,
31682 #[doc = "Current vehicle height above lat/lon terrain height"]
31683 pub current_height: f32,
31684 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
31685 pub spacing: u16,
31686 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
31687 pub pending: u16,
31688 #[doc = "Number of 4x4 terrain blocks in memory"]
31689 pub loaded: u16,
31690}
31691impl TERRAIN_REPORT_DATA {
31692 pub const ENCODED_LEN: usize = 22usize;
31693 pub const DEFAULT: Self = Self {
31694 lat: 0_i32,
31695 lon: 0_i32,
31696 terrain_height: 0.0_f32,
31697 current_height: 0.0_f32,
31698 spacing: 0_u16,
31699 pending: 0_u16,
31700 loaded: 0_u16,
31701 };
31702 #[cfg(feature = "arbitrary")]
31703 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31704 use arbitrary::{Arbitrary, Unstructured};
31705 let mut buf = [0u8; 1024];
31706 rng.fill_bytes(&mut buf);
31707 let mut unstructured = Unstructured::new(&buf);
31708 Self::arbitrary(&mut unstructured).unwrap_or_default()
31709 }
31710}
31711impl Default for TERRAIN_REPORT_DATA {
31712 fn default() -> Self {
31713 Self::DEFAULT.clone()
31714 }
31715}
31716impl MessageData for TERRAIN_REPORT_DATA {
31717 type Message = MavMessage;
31718 const ID: u32 = 136u32;
31719 const NAME: &'static str = "TERRAIN_REPORT";
31720 const EXTRA_CRC: u8 = 1u8;
31721 const ENCODED_LEN: usize = 22usize;
31722 fn deser(
31723 _version: MavlinkVersion,
31724 __input: &[u8],
31725 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31726 let avail_len = __input.len();
31727 let mut payload_buf = [0; Self::ENCODED_LEN];
31728 let mut buf = if avail_len < Self::ENCODED_LEN {
31729 payload_buf[0..avail_len].copy_from_slice(__input);
31730 Bytes::new(&payload_buf)
31731 } else {
31732 Bytes::new(__input)
31733 };
31734 let mut __struct = Self::default();
31735 __struct.lat = buf.get_i32_le()?;
31736 __struct.lon = buf.get_i32_le()?;
31737 __struct.terrain_height = buf.get_f32_le()?;
31738 __struct.current_height = buf.get_f32_le()?;
31739 __struct.spacing = buf.get_u16_le()?;
31740 __struct.pending = buf.get_u16_le()?;
31741 __struct.loaded = buf.get_u16_le()?;
31742 Ok(__struct)
31743 }
31744 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31745 let mut __tmp = BytesMut::new(bytes);
31746 #[allow(clippy::absurd_extreme_comparisons)]
31747 #[allow(unused_comparisons)]
31748 if __tmp.remaining() < Self::ENCODED_LEN {
31749 panic!(
31750 "buffer is too small (need {} bytes, but got {})",
31751 Self::ENCODED_LEN,
31752 __tmp.remaining(),
31753 )
31754 }
31755 __tmp.put_i32_le(self.lat);
31756 __tmp.put_i32_le(self.lon);
31757 __tmp.put_f32_le(self.terrain_height);
31758 __tmp.put_f32_le(self.current_height);
31759 __tmp.put_u16_le(self.spacing);
31760 __tmp.put_u16_le(self.pending);
31761 __tmp.put_u16_le(self.loaded);
31762 if matches!(version, MavlinkVersion::V2) {
31763 let len = __tmp.len();
31764 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31765 } else {
31766 __tmp.len()
31767 }
31768 }
31769}
31770#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
31771#[doc = ""]
31772#[doc = "ID: 133"]
31773#[derive(Debug, Clone, PartialEq)]
31774#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31775#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31776#[cfg_attr(feature = "ts", derive(TS))]
31777#[cfg_attr(feature = "ts", ts(export))]
31778pub struct TERRAIN_REQUEST_DATA {
31779 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
31780 pub mask: u64,
31781 #[doc = "Latitude of SW corner of first grid"]
31782 pub lat: i32,
31783 #[doc = "Longitude of SW corner of first grid"]
31784 pub lon: i32,
31785 #[doc = "Grid spacing"]
31786 pub grid_spacing: u16,
31787}
31788impl TERRAIN_REQUEST_DATA {
31789 pub const ENCODED_LEN: usize = 18usize;
31790 pub const DEFAULT: Self = Self {
31791 mask: 0_u64,
31792 lat: 0_i32,
31793 lon: 0_i32,
31794 grid_spacing: 0_u16,
31795 };
31796 #[cfg(feature = "arbitrary")]
31797 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31798 use arbitrary::{Arbitrary, Unstructured};
31799 let mut buf = [0u8; 1024];
31800 rng.fill_bytes(&mut buf);
31801 let mut unstructured = Unstructured::new(&buf);
31802 Self::arbitrary(&mut unstructured).unwrap_or_default()
31803 }
31804}
31805impl Default for TERRAIN_REQUEST_DATA {
31806 fn default() -> Self {
31807 Self::DEFAULT.clone()
31808 }
31809}
31810impl MessageData for TERRAIN_REQUEST_DATA {
31811 type Message = MavMessage;
31812 const ID: u32 = 133u32;
31813 const NAME: &'static str = "TERRAIN_REQUEST";
31814 const EXTRA_CRC: u8 = 6u8;
31815 const ENCODED_LEN: usize = 18usize;
31816 fn deser(
31817 _version: MavlinkVersion,
31818 __input: &[u8],
31819 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31820 let avail_len = __input.len();
31821 let mut payload_buf = [0; Self::ENCODED_LEN];
31822 let mut buf = if avail_len < Self::ENCODED_LEN {
31823 payload_buf[0..avail_len].copy_from_slice(__input);
31824 Bytes::new(&payload_buf)
31825 } else {
31826 Bytes::new(__input)
31827 };
31828 let mut __struct = Self::default();
31829 __struct.mask = buf.get_u64_le()?;
31830 __struct.lat = buf.get_i32_le()?;
31831 __struct.lon = buf.get_i32_le()?;
31832 __struct.grid_spacing = buf.get_u16_le()?;
31833 Ok(__struct)
31834 }
31835 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31836 let mut __tmp = BytesMut::new(bytes);
31837 #[allow(clippy::absurd_extreme_comparisons)]
31838 #[allow(unused_comparisons)]
31839 if __tmp.remaining() < Self::ENCODED_LEN {
31840 panic!(
31841 "buffer is too small (need {} bytes, but got {})",
31842 Self::ENCODED_LEN,
31843 __tmp.remaining(),
31844 )
31845 }
31846 __tmp.put_u64_le(self.mask);
31847 __tmp.put_i32_le(self.lat);
31848 __tmp.put_i32_le(self.lon);
31849 __tmp.put_u16_le(self.grid_spacing);
31850 if matches!(version, MavlinkVersion::V2) {
31851 let len = __tmp.len();
31852 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31853 } else {
31854 __tmp.len()
31855 }
31856 }
31857}
31858#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
31859#[doc = ""]
31860#[doc = "ID: 111"]
31861#[derive(Debug, Clone, PartialEq)]
31862#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31863#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31864#[cfg_attr(feature = "ts", derive(TS))]
31865#[cfg_attr(feature = "ts", ts(export))]
31866pub struct TIMESYNC_DATA {
31867 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
31868 pub tc1: i64,
31869 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
31870 pub ts1: i64,
31871 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
31872 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31873 pub target_system: u8,
31874 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
31875 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31876 pub target_component: u8,
31877}
31878impl TIMESYNC_DATA {
31879 pub const ENCODED_LEN: usize = 18usize;
31880 pub const DEFAULT: Self = Self {
31881 tc1: 0_i64,
31882 ts1: 0_i64,
31883 target_system: 0_u8,
31884 target_component: 0_u8,
31885 };
31886 #[cfg(feature = "arbitrary")]
31887 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31888 use arbitrary::{Arbitrary, Unstructured};
31889 let mut buf = [0u8; 1024];
31890 rng.fill_bytes(&mut buf);
31891 let mut unstructured = Unstructured::new(&buf);
31892 Self::arbitrary(&mut unstructured).unwrap_or_default()
31893 }
31894}
31895impl Default for TIMESYNC_DATA {
31896 fn default() -> Self {
31897 Self::DEFAULT.clone()
31898 }
31899}
31900impl MessageData for TIMESYNC_DATA {
31901 type Message = MavMessage;
31902 const ID: u32 = 111u32;
31903 const NAME: &'static str = "TIMESYNC";
31904 const EXTRA_CRC: u8 = 34u8;
31905 const ENCODED_LEN: usize = 18usize;
31906 fn deser(
31907 _version: MavlinkVersion,
31908 __input: &[u8],
31909 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31910 let avail_len = __input.len();
31911 let mut payload_buf = [0; Self::ENCODED_LEN];
31912 let mut buf = if avail_len < Self::ENCODED_LEN {
31913 payload_buf[0..avail_len].copy_from_slice(__input);
31914 Bytes::new(&payload_buf)
31915 } else {
31916 Bytes::new(__input)
31917 };
31918 let mut __struct = Self::default();
31919 __struct.tc1 = buf.get_i64_le()?;
31920 __struct.ts1 = buf.get_i64_le()?;
31921 __struct.target_system = buf.get_u8()?;
31922 __struct.target_component = buf.get_u8()?;
31923 Ok(__struct)
31924 }
31925 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31926 let mut __tmp = BytesMut::new(bytes);
31927 #[allow(clippy::absurd_extreme_comparisons)]
31928 #[allow(unused_comparisons)]
31929 if __tmp.remaining() < Self::ENCODED_LEN {
31930 panic!(
31931 "buffer is too small (need {} bytes, but got {})",
31932 Self::ENCODED_LEN,
31933 __tmp.remaining(),
31934 )
31935 }
31936 __tmp.put_i64_le(self.tc1);
31937 __tmp.put_i64_le(self.ts1);
31938 if matches!(version, MavlinkVersion::V2) {
31939 __tmp.put_u8(self.target_system);
31940 __tmp.put_u8(self.target_component);
31941 let len = __tmp.len();
31942 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31943 } else {
31944 __tmp.len()
31945 }
31946 }
31947}
31948#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
31949#[doc = ""]
31950#[doc = "ID: 380"]
31951#[derive(Debug, Clone, PartialEq)]
31952#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31953#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31954#[cfg_attr(feature = "ts", derive(TS))]
31955#[cfg_attr(feature = "ts", ts(export))]
31956pub struct TIME_ESTIMATE_TO_TARGET_DATA {
31957 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
31958 pub safe_return: i32,
31959 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
31960 pub land: i32,
31961 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
31962 pub mission_next_item: i32,
31963 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
31964 pub mission_end: i32,
31965 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
31966 pub commanded_action: i32,
31967}
31968impl TIME_ESTIMATE_TO_TARGET_DATA {
31969 pub const ENCODED_LEN: usize = 20usize;
31970 pub const DEFAULT: Self = Self {
31971 safe_return: 0_i32,
31972 land: 0_i32,
31973 mission_next_item: 0_i32,
31974 mission_end: 0_i32,
31975 commanded_action: 0_i32,
31976 };
31977 #[cfg(feature = "arbitrary")]
31978 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31979 use arbitrary::{Arbitrary, Unstructured};
31980 let mut buf = [0u8; 1024];
31981 rng.fill_bytes(&mut buf);
31982 let mut unstructured = Unstructured::new(&buf);
31983 Self::arbitrary(&mut unstructured).unwrap_or_default()
31984 }
31985}
31986impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
31987 fn default() -> Self {
31988 Self::DEFAULT.clone()
31989 }
31990}
31991impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
31992 type Message = MavMessage;
31993 const ID: u32 = 380u32;
31994 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
31995 const EXTRA_CRC: u8 = 232u8;
31996 const ENCODED_LEN: usize = 20usize;
31997 fn deser(
31998 _version: MavlinkVersion,
31999 __input: &[u8],
32000 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32001 let avail_len = __input.len();
32002 let mut payload_buf = [0; Self::ENCODED_LEN];
32003 let mut buf = if avail_len < Self::ENCODED_LEN {
32004 payload_buf[0..avail_len].copy_from_slice(__input);
32005 Bytes::new(&payload_buf)
32006 } else {
32007 Bytes::new(__input)
32008 };
32009 let mut __struct = Self::default();
32010 __struct.safe_return = buf.get_i32_le()?;
32011 __struct.land = buf.get_i32_le()?;
32012 __struct.mission_next_item = buf.get_i32_le()?;
32013 __struct.mission_end = buf.get_i32_le()?;
32014 __struct.commanded_action = buf.get_i32_le()?;
32015 Ok(__struct)
32016 }
32017 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32018 let mut __tmp = BytesMut::new(bytes);
32019 #[allow(clippy::absurd_extreme_comparisons)]
32020 #[allow(unused_comparisons)]
32021 if __tmp.remaining() < Self::ENCODED_LEN {
32022 panic!(
32023 "buffer is too small (need {} bytes, but got {})",
32024 Self::ENCODED_LEN,
32025 __tmp.remaining(),
32026 )
32027 }
32028 __tmp.put_i32_le(self.safe_return);
32029 __tmp.put_i32_le(self.land);
32030 __tmp.put_i32_le(self.mission_next_item);
32031 __tmp.put_i32_le(self.mission_end);
32032 __tmp.put_i32_le(self.commanded_action);
32033 if matches!(version, MavlinkVersion::V2) {
32034 let len = __tmp.len();
32035 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32036 } else {
32037 __tmp.len()
32038 }
32039 }
32040}
32041#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
32042#[doc = ""]
32043#[doc = "ID: 333"]
32044#[derive(Debug, Clone, PartialEq)]
32045#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32046#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32047#[cfg_attr(feature = "ts", derive(TS))]
32048#[cfg_attr(feature = "ts", ts(export))]
32049pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
32050 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32051 pub time_usec: u64,
32052 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
32053 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32054 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32055 pub pos_x: [f32; 5],
32056 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
32057 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32058 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32059 pub pos_y: [f32; 5],
32060 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
32061 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32062 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32063 pub pos_z: [f32; 5],
32064 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
32065 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32066 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32067 pub delta: [f32; 5],
32068 #[doc = "Yaw. Set to NaN for unchanged"]
32069 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32070 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32071 pub pos_yaw: [f32; 5],
32072 #[doc = "Number of valid control points (up-to 5 points are possible)"]
32073 pub valid_points: u8,
32074}
32075impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
32076 pub const ENCODED_LEN: usize = 109usize;
32077 pub const DEFAULT: Self = Self {
32078 time_usec: 0_u64,
32079 pos_x: [0.0_f32; 5usize],
32080 pos_y: [0.0_f32; 5usize],
32081 pos_z: [0.0_f32; 5usize],
32082 delta: [0.0_f32; 5usize],
32083 pos_yaw: [0.0_f32; 5usize],
32084 valid_points: 0_u8,
32085 };
32086 #[cfg(feature = "arbitrary")]
32087 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32088 use arbitrary::{Arbitrary, Unstructured};
32089 let mut buf = [0u8; 1024];
32090 rng.fill_bytes(&mut buf);
32091 let mut unstructured = Unstructured::new(&buf);
32092 Self::arbitrary(&mut unstructured).unwrap_or_default()
32093 }
32094}
32095impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
32096 fn default() -> Self {
32097 Self::DEFAULT.clone()
32098 }
32099}
32100impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
32101 type Message = MavMessage;
32102 const ID: u32 = 333u32;
32103 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
32104 const EXTRA_CRC: u8 = 231u8;
32105 const ENCODED_LEN: usize = 109usize;
32106 fn deser(
32107 _version: MavlinkVersion,
32108 __input: &[u8],
32109 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32110 let avail_len = __input.len();
32111 let mut payload_buf = [0; Self::ENCODED_LEN];
32112 let mut buf = if avail_len < Self::ENCODED_LEN {
32113 payload_buf[0..avail_len].copy_from_slice(__input);
32114 Bytes::new(&payload_buf)
32115 } else {
32116 Bytes::new(__input)
32117 };
32118 let mut __struct = Self::default();
32119 __struct.time_usec = buf.get_u64_le()?;
32120 for v in &mut __struct.pos_x {
32121 let val = buf.get_f32_le()?;
32122 *v = val;
32123 }
32124 for v in &mut __struct.pos_y {
32125 let val = buf.get_f32_le()?;
32126 *v = val;
32127 }
32128 for v in &mut __struct.pos_z {
32129 let val = buf.get_f32_le()?;
32130 *v = val;
32131 }
32132 for v in &mut __struct.delta {
32133 let val = buf.get_f32_le()?;
32134 *v = val;
32135 }
32136 for v in &mut __struct.pos_yaw {
32137 let val = buf.get_f32_le()?;
32138 *v = val;
32139 }
32140 __struct.valid_points = buf.get_u8()?;
32141 Ok(__struct)
32142 }
32143 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32144 let mut __tmp = BytesMut::new(bytes);
32145 #[allow(clippy::absurd_extreme_comparisons)]
32146 #[allow(unused_comparisons)]
32147 if __tmp.remaining() < Self::ENCODED_LEN {
32148 panic!(
32149 "buffer is too small (need {} bytes, but got {})",
32150 Self::ENCODED_LEN,
32151 __tmp.remaining(),
32152 )
32153 }
32154 __tmp.put_u64_le(self.time_usec);
32155 for val in &self.pos_x {
32156 __tmp.put_f32_le(*val);
32157 }
32158 for val in &self.pos_y {
32159 __tmp.put_f32_le(*val);
32160 }
32161 for val in &self.pos_z {
32162 __tmp.put_f32_le(*val);
32163 }
32164 for val in &self.delta {
32165 __tmp.put_f32_le(*val);
32166 }
32167 for val in &self.pos_yaw {
32168 __tmp.put_f32_le(*val);
32169 }
32170 __tmp.put_u8(self.valid_points);
32171 if matches!(version, MavlinkVersion::V2) {
32172 let len = __tmp.len();
32173 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32174 } else {
32175 __tmp.len()
32176 }
32177 }
32178}
32179#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
32180#[doc = ""]
32181#[doc = "ID: 332"]
32182#[derive(Debug, Clone, PartialEq)]
32183#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32185#[cfg_attr(feature = "ts", derive(TS))]
32186#[cfg_attr(feature = "ts", ts(export))]
32187pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
32188 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32189 pub time_usec: u64,
32190 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
32191 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32192 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32193 pub pos_x: [f32; 5],
32194 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
32195 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32196 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32197 pub pos_y: [f32; 5],
32198 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
32199 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32200 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32201 pub pos_z: [f32; 5],
32202 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
32203 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32204 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32205 pub vel_x: [f32; 5],
32206 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
32207 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32208 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32209 pub vel_y: [f32; 5],
32210 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
32211 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32212 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32213 pub vel_z: [f32; 5],
32214 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
32215 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32216 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32217 pub acc_x: [f32; 5],
32218 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
32219 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32220 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32221 pub acc_y: [f32; 5],
32222 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
32223 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32224 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32225 pub acc_z: [f32; 5],
32226 #[doc = "Yaw angle, set to NaN if not being used"]
32227 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32228 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32229 pub pos_yaw: [f32; 5],
32230 #[doc = "Yaw rate, set to NaN if not being used"]
32231 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32232 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32233 pub vel_yaw: [f32; 5],
32234 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
32235 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32236 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32237 pub command: [u16; 5],
32238 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
32239 pub valid_points: u8,
32240}
32241impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
32242 pub const ENCODED_LEN: usize = 239usize;
32243 pub const DEFAULT: Self = Self {
32244 time_usec: 0_u64,
32245 pos_x: [0.0_f32; 5usize],
32246 pos_y: [0.0_f32; 5usize],
32247 pos_z: [0.0_f32; 5usize],
32248 vel_x: [0.0_f32; 5usize],
32249 vel_y: [0.0_f32; 5usize],
32250 vel_z: [0.0_f32; 5usize],
32251 acc_x: [0.0_f32; 5usize],
32252 acc_y: [0.0_f32; 5usize],
32253 acc_z: [0.0_f32; 5usize],
32254 pos_yaw: [0.0_f32; 5usize],
32255 vel_yaw: [0.0_f32; 5usize],
32256 command: [0_u16; 5usize],
32257 valid_points: 0_u8,
32258 };
32259 #[cfg(feature = "arbitrary")]
32260 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32261 use arbitrary::{Arbitrary, Unstructured};
32262 let mut buf = [0u8; 1024];
32263 rng.fill_bytes(&mut buf);
32264 let mut unstructured = Unstructured::new(&buf);
32265 Self::arbitrary(&mut unstructured).unwrap_or_default()
32266 }
32267}
32268impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
32269 fn default() -> Self {
32270 Self::DEFAULT.clone()
32271 }
32272}
32273impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
32274 type Message = MavMessage;
32275 const ID: u32 = 332u32;
32276 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
32277 const EXTRA_CRC: u8 = 236u8;
32278 const ENCODED_LEN: usize = 239usize;
32279 fn deser(
32280 _version: MavlinkVersion,
32281 __input: &[u8],
32282 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32283 let avail_len = __input.len();
32284 let mut payload_buf = [0; Self::ENCODED_LEN];
32285 let mut buf = if avail_len < Self::ENCODED_LEN {
32286 payload_buf[0..avail_len].copy_from_slice(__input);
32287 Bytes::new(&payload_buf)
32288 } else {
32289 Bytes::new(__input)
32290 };
32291 let mut __struct = Self::default();
32292 __struct.time_usec = buf.get_u64_le()?;
32293 for v in &mut __struct.pos_x {
32294 let val = buf.get_f32_le()?;
32295 *v = val;
32296 }
32297 for v in &mut __struct.pos_y {
32298 let val = buf.get_f32_le()?;
32299 *v = val;
32300 }
32301 for v in &mut __struct.pos_z {
32302 let val = buf.get_f32_le()?;
32303 *v = val;
32304 }
32305 for v in &mut __struct.vel_x {
32306 let val = buf.get_f32_le()?;
32307 *v = val;
32308 }
32309 for v in &mut __struct.vel_y {
32310 let val = buf.get_f32_le()?;
32311 *v = val;
32312 }
32313 for v in &mut __struct.vel_z {
32314 let val = buf.get_f32_le()?;
32315 *v = val;
32316 }
32317 for v in &mut __struct.acc_x {
32318 let val = buf.get_f32_le()?;
32319 *v = val;
32320 }
32321 for v in &mut __struct.acc_y {
32322 let val = buf.get_f32_le()?;
32323 *v = val;
32324 }
32325 for v in &mut __struct.acc_z {
32326 let val = buf.get_f32_le()?;
32327 *v = val;
32328 }
32329 for v in &mut __struct.pos_yaw {
32330 let val = buf.get_f32_le()?;
32331 *v = val;
32332 }
32333 for v in &mut __struct.vel_yaw {
32334 let val = buf.get_f32_le()?;
32335 *v = val;
32336 }
32337 for v in &mut __struct.command {
32338 let val = buf.get_u16_le()?;
32339 *v = val;
32340 }
32341 __struct.valid_points = buf.get_u8()?;
32342 Ok(__struct)
32343 }
32344 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32345 let mut __tmp = BytesMut::new(bytes);
32346 #[allow(clippy::absurd_extreme_comparisons)]
32347 #[allow(unused_comparisons)]
32348 if __tmp.remaining() < Self::ENCODED_LEN {
32349 panic!(
32350 "buffer is too small (need {} bytes, but got {})",
32351 Self::ENCODED_LEN,
32352 __tmp.remaining(),
32353 )
32354 }
32355 __tmp.put_u64_le(self.time_usec);
32356 for val in &self.pos_x {
32357 __tmp.put_f32_le(*val);
32358 }
32359 for val in &self.pos_y {
32360 __tmp.put_f32_le(*val);
32361 }
32362 for val in &self.pos_z {
32363 __tmp.put_f32_le(*val);
32364 }
32365 for val in &self.vel_x {
32366 __tmp.put_f32_le(*val);
32367 }
32368 for val in &self.vel_y {
32369 __tmp.put_f32_le(*val);
32370 }
32371 for val in &self.vel_z {
32372 __tmp.put_f32_le(*val);
32373 }
32374 for val in &self.acc_x {
32375 __tmp.put_f32_le(*val);
32376 }
32377 for val in &self.acc_y {
32378 __tmp.put_f32_le(*val);
32379 }
32380 for val in &self.acc_z {
32381 __tmp.put_f32_le(*val);
32382 }
32383 for val in &self.pos_yaw {
32384 __tmp.put_f32_le(*val);
32385 }
32386 for val in &self.vel_yaw {
32387 __tmp.put_f32_le(*val);
32388 }
32389 for val in &self.command {
32390 __tmp.put_u16_le(*val);
32391 }
32392 __tmp.put_u8(self.valid_points);
32393 if matches!(version, MavlinkVersion::V2) {
32394 let len = __tmp.len();
32395 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32396 } else {
32397 __tmp.len()
32398 }
32399 }
32400}
32401#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
32402#[doc = ""]
32403#[doc = "ID: 385"]
32404#[derive(Debug, Clone, PartialEq)]
32405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32407#[cfg_attr(feature = "ts", derive(TS))]
32408#[cfg_attr(feature = "ts", ts(export))]
32409pub struct TUNNEL_DATA {
32410 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
32411 pub payload_type: MavTunnelPayloadType,
32412 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
32413 pub target_system: u8,
32414 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
32415 pub target_component: u8,
32416 #[doc = "Length of the data transported in payload"]
32417 pub payload_length: u8,
32418 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
32419 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32420 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32421 pub payload: [u8; 128],
32422}
32423impl TUNNEL_DATA {
32424 pub const ENCODED_LEN: usize = 133usize;
32425 pub const DEFAULT: Self = Self {
32426 payload_type: MavTunnelPayloadType::DEFAULT,
32427 target_system: 0_u8,
32428 target_component: 0_u8,
32429 payload_length: 0_u8,
32430 payload: [0_u8; 128usize],
32431 };
32432 #[cfg(feature = "arbitrary")]
32433 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32434 use arbitrary::{Arbitrary, Unstructured};
32435 let mut buf = [0u8; 1024];
32436 rng.fill_bytes(&mut buf);
32437 let mut unstructured = Unstructured::new(&buf);
32438 Self::arbitrary(&mut unstructured).unwrap_or_default()
32439 }
32440}
32441impl Default for TUNNEL_DATA {
32442 fn default() -> Self {
32443 Self::DEFAULT.clone()
32444 }
32445}
32446impl MessageData for TUNNEL_DATA {
32447 type Message = MavMessage;
32448 const ID: u32 = 385u32;
32449 const NAME: &'static str = "TUNNEL";
32450 const EXTRA_CRC: u8 = 147u8;
32451 const ENCODED_LEN: usize = 133usize;
32452 fn deser(
32453 _version: MavlinkVersion,
32454 __input: &[u8],
32455 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32456 let avail_len = __input.len();
32457 let mut payload_buf = [0; Self::ENCODED_LEN];
32458 let mut buf = if avail_len < Self::ENCODED_LEN {
32459 payload_buf[0..avail_len].copy_from_slice(__input);
32460 Bytes::new(&payload_buf)
32461 } else {
32462 Bytes::new(__input)
32463 };
32464 let mut __struct = Self::default();
32465 let tmp = buf.get_u16_le()?;
32466 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
32467 ::mavlink_core::error::ParserError::InvalidEnum {
32468 enum_type: "MavTunnelPayloadType",
32469 value: tmp as u64,
32470 },
32471 )?;
32472 __struct.target_system = buf.get_u8()?;
32473 __struct.target_component = buf.get_u8()?;
32474 __struct.payload_length = buf.get_u8()?;
32475 for v in &mut __struct.payload {
32476 let val = buf.get_u8()?;
32477 *v = val;
32478 }
32479 Ok(__struct)
32480 }
32481 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32482 let mut __tmp = BytesMut::new(bytes);
32483 #[allow(clippy::absurd_extreme_comparisons)]
32484 #[allow(unused_comparisons)]
32485 if __tmp.remaining() < Self::ENCODED_LEN {
32486 panic!(
32487 "buffer is too small (need {} bytes, but got {})",
32488 Self::ENCODED_LEN,
32489 __tmp.remaining(),
32490 )
32491 }
32492 __tmp.put_u16_le(self.payload_type as u16);
32493 __tmp.put_u8(self.target_system);
32494 __tmp.put_u8(self.target_component);
32495 __tmp.put_u8(self.payload_length);
32496 for val in &self.payload {
32497 __tmp.put_u8(*val);
32498 }
32499 if matches!(version, MavlinkVersion::V2) {
32500 let len = __tmp.len();
32501 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32502 } else {
32503 __tmp.len()
32504 }
32505 }
32506}
32507#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
32508#[doc = ""]
32509#[doc = "ID: 311"]
32510#[derive(Debug, Clone, PartialEq)]
32511#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32512#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32513#[cfg_attr(feature = "ts", derive(TS))]
32514#[cfg_attr(feature = "ts", ts(export))]
32515pub struct UAVCAN_NODE_INFO_DATA {
32516 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32517 pub time_usec: u64,
32518 #[doc = "Time since the start-up of the node."]
32519 pub uptime_sec: u32,
32520 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
32521 pub sw_vcs_commit: u32,
32522 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
32523 #[cfg_attr(feature = "ts", ts(type = "string"))]
32524 pub name: CharArray<80>,
32525 #[doc = "Hardware major version number."]
32526 pub hw_version_major: u8,
32527 #[doc = "Hardware minor version number."]
32528 pub hw_version_minor: u8,
32529 #[doc = "Hardware unique 128-bit ID."]
32530 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32531 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32532 pub hw_unique_id: [u8; 16],
32533 #[doc = "Software major version number."]
32534 pub sw_version_major: u8,
32535 #[doc = "Software minor version number."]
32536 pub sw_version_minor: u8,
32537}
32538impl UAVCAN_NODE_INFO_DATA {
32539 pub const ENCODED_LEN: usize = 116usize;
32540 pub const DEFAULT: Self = Self {
32541 time_usec: 0_u64,
32542 uptime_sec: 0_u32,
32543 sw_vcs_commit: 0_u32,
32544 name: CharArray::new([0_u8; 80usize]),
32545 hw_version_major: 0_u8,
32546 hw_version_minor: 0_u8,
32547 hw_unique_id: [0_u8; 16usize],
32548 sw_version_major: 0_u8,
32549 sw_version_minor: 0_u8,
32550 };
32551 #[cfg(feature = "arbitrary")]
32552 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32553 use arbitrary::{Arbitrary, Unstructured};
32554 let mut buf = [0u8; 1024];
32555 rng.fill_bytes(&mut buf);
32556 let mut unstructured = Unstructured::new(&buf);
32557 Self::arbitrary(&mut unstructured).unwrap_or_default()
32558 }
32559}
32560impl Default for UAVCAN_NODE_INFO_DATA {
32561 fn default() -> Self {
32562 Self::DEFAULT.clone()
32563 }
32564}
32565impl MessageData for UAVCAN_NODE_INFO_DATA {
32566 type Message = MavMessage;
32567 const ID: u32 = 311u32;
32568 const NAME: &'static str = "UAVCAN_NODE_INFO";
32569 const EXTRA_CRC: u8 = 95u8;
32570 const ENCODED_LEN: usize = 116usize;
32571 fn deser(
32572 _version: MavlinkVersion,
32573 __input: &[u8],
32574 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32575 let avail_len = __input.len();
32576 let mut payload_buf = [0; Self::ENCODED_LEN];
32577 let mut buf = if avail_len < Self::ENCODED_LEN {
32578 payload_buf[0..avail_len].copy_from_slice(__input);
32579 Bytes::new(&payload_buf)
32580 } else {
32581 Bytes::new(__input)
32582 };
32583 let mut __struct = Self::default();
32584 __struct.time_usec = buf.get_u64_le()?;
32585 __struct.uptime_sec = buf.get_u32_le()?;
32586 __struct.sw_vcs_commit = buf.get_u32_le()?;
32587 let mut tmp = [0_u8; 80usize];
32588 for v in &mut tmp {
32589 *v = buf.get_u8()?;
32590 }
32591 __struct.name = CharArray::new(tmp);
32592 __struct.hw_version_major = buf.get_u8()?;
32593 __struct.hw_version_minor = buf.get_u8()?;
32594 for v in &mut __struct.hw_unique_id {
32595 let val = buf.get_u8()?;
32596 *v = val;
32597 }
32598 __struct.sw_version_major = buf.get_u8()?;
32599 __struct.sw_version_minor = buf.get_u8()?;
32600 Ok(__struct)
32601 }
32602 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32603 let mut __tmp = BytesMut::new(bytes);
32604 #[allow(clippy::absurd_extreme_comparisons)]
32605 #[allow(unused_comparisons)]
32606 if __tmp.remaining() < Self::ENCODED_LEN {
32607 panic!(
32608 "buffer is too small (need {} bytes, but got {})",
32609 Self::ENCODED_LEN,
32610 __tmp.remaining(),
32611 )
32612 }
32613 __tmp.put_u64_le(self.time_usec);
32614 __tmp.put_u32_le(self.uptime_sec);
32615 __tmp.put_u32_le(self.sw_vcs_commit);
32616 for val in &self.name {
32617 __tmp.put_u8(*val);
32618 }
32619 __tmp.put_u8(self.hw_version_major);
32620 __tmp.put_u8(self.hw_version_minor);
32621 for val in &self.hw_unique_id {
32622 __tmp.put_u8(*val);
32623 }
32624 __tmp.put_u8(self.sw_version_major);
32625 __tmp.put_u8(self.sw_version_minor);
32626 if matches!(version, MavlinkVersion::V2) {
32627 let len = __tmp.len();
32628 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32629 } else {
32630 __tmp.len()
32631 }
32632 }
32633}
32634#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
32635#[doc = ""]
32636#[doc = "ID: 310"]
32637#[derive(Debug, Clone, PartialEq)]
32638#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32639#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32640#[cfg_attr(feature = "ts", derive(TS))]
32641#[cfg_attr(feature = "ts", ts(export))]
32642pub struct UAVCAN_NODE_STATUS_DATA {
32643 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32644 pub time_usec: u64,
32645 #[doc = "Time since the start-up of the node."]
32646 pub uptime_sec: u32,
32647 #[doc = "Vendor-specific status information."]
32648 pub vendor_specific_status_code: u16,
32649 #[doc = "Generalized node health status."]
32650 pub health: UavcanNodeHealth,
32651 #[doc = "Generalized operating mode."]
32652 pub mode: UavcanNodeMode,
32653 #[doc = "Not used currently."]
32654 pub sub_mode: u8,
32655}
32656impl UAVCAN_NODE_STATUS_DATA {
32657 pub const ENCODED_LEN: usize = 17usize;
32658 pub const DEFAULT: Self = Self {
32659 time_usec: 0_u64,
32660 uptime_sec: 0_u32,
32661 vendor_specific_status_code: 0_u16,
32662 health: UavcanNodeHealth::DEFAULT,
32663 mode: UavcanNodeMode::DEFAULT,
32664 sub_mode: 0_u8,
32665 };
32666 #[cfg(feature = "arbitrary")]
32667 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32668 use arbitrary::{Arbitrary, Unstructured};
32669 let mut buf = [0u8; 1024];
32670 rng.fill_bytes(&mut buf);
32671 let mut unstructured = Unstructured::new(&buf);
32672 Self::arbitrary(&mut unstructured).unwrap_or_default()
32673 }
32674}
32675impl Default for UAVCAN_NODE_STATUS_DATA {
32676 fn default() -> Self {
32677 Self::DEFAULT.clone()
32678 }
32679}
32680impl MessageData for UAVCAN_NODE_STATUS_DATA {
32681 type Message = MavMessage;
32682 const ID: u32 = 310u32;
32683 const NAME: &'static str = "UAVCAN_NODE_STATUS";
32684 const EXTRA_CRC: u8 = 28u8;
32685 const ENCODED_LEN: usize = 17usize;
32686 fn deser(
32687 _version: MavlinkVersion,
32688 __input: &[u8],
32689 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32690 let avail_len = __input.len();
32691 let mut payload_buf = [0; Self::ENCODED_LEN];
32692 let mut buf = if avail_len < Self::ENCODED_LEN {
32693 payload_buf[0..avail_len].copy_from_slice(__input);
32694 Bytes::new(&payload_buf)
32695 } else {
32696 Bytes::new(__input)
32697 };
32698 let mut __struct = Self::default();
32699 __struct.time_usec = buf.get_u64_le()?;
32700 __struct.uptime_sec = buf.get_u32_le()?;
32701 __struct.vendor_specific_status_code = buf.get_u16_le()?;
32702 let tmp = buf.get_u8()?;
32703 __struct.health =
32704 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32705 enum_type: "UavcanNodeHealth",
32706 value: tmp as u64,
32707 })?;
32708 let tmp = buf.get_u8()?;
32709 __struct.mode =
32710 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32711 enum_type: "UavcanNodeMode",
32712 value: tmp as u64,
32713 })?;
32714 __struct.sub_mode = buf.get_u8()?;
32715 Ok(__struct)
32716 }
32717 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32718 let mut __tmp = BytesMut::new(bytes);
32719 #[allow(clippy::absurd_extreme_comparisons)]
32720 #[allow(unused_comparisons)]
32721 if __tmp.remaining() < Self::ENCODED_LEN {
32722 panic!(
32723 "buffer is too small (need {} bytes, but got {})",
32724 Self::ENCODED_LEN,
32725 __tmp.remaining(),
32726 )
32727 }
32728 __tmp.put_u64_le(self.time_usec);
32729 __tmp.put_u32_le(self.uptime_sec);
32730 __tmp.put_u16_le(self.vendor_specific_status_code);
32731 __tmp.put_u8(self.health as u8);
32732 __tmp.put_u8(self.mode as u8);
32733 __tmp.put_u8(self.sub_mode);
32734 if matches!(version, MavlinkVersion::V2) {
32735 let len = __tmp.len();
32736 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32737 } else {
32738 __tmp.len()
32739 }
32740 }
32741}
32742#[doc = "The global position resulting from GPS and sensor fusion."]
32743#[doc = ""]
32744#[doc = "ID: 340"]
32745#[derive(Debug, Clone, PartialEq)]
32746#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32747#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32748#[cfg_attr(feature = "ts", derive(TS))]
32749#[cfg_attr(feature = "ts", ts(export))]
32750pub struct UTM_GLOBAL_POSITION_DATA {
32751 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
32752 pub time: u64,
32753 #[doc = "Latitude (WGS84)"]
32754 pub lat: i32,
32755 #[doc = "Longitude (WGS84)"]
32756 pub lon: i32,
32757 #[doc = "Altitude (WGS84)"]
32758 pub alt: i32,
32759 #[doc = "Altitude above ground"]
32760 pub relative_alt: i32,
32761 #[doc = "Next waypoint, latitude (WGS84)"]
32762 pub next_lat: i32,
32763 #[doc = "Next waypoint, longitude (WGS84)"]
32764 pub next_lon: i32,
32765 #[doc = "Next waypoint, altitude (WGS84)"]
32766 pub next_alt: i32,
32767 #[doc = "Ground X speed (latitude, positive north)"]
32768 pub vx: i16,
32769 #[doc = "Ground Y speed (longitude, positive east)"]
32770 pub vy: i16,
32771 #[doc = "Ground Z speed (altitude, positive down)"]
32772 pub vz: i16,
32773 #[doc = "Horizontal position uncertainty (standard deviation)"]
32774 pub h_acc: u16,
32775 #[doc = "Altitude uncertainty (standard deviation)"]
32776 pub v_acc: u16,
32777 #[doc = "Speed uncertainty (standard deviation)"]
32778 pub vel_acc: u16,
32779 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
32780 pub update_rate: u16,
32781 #[doc = "Unique UAS ID."]
32782 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32783 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32784 pub uas_id: [u8; 18],
32785 #[doc = "Flight state"]
32786 pub flight_state: UtmFlightState,
32787 #[doc = "Bitwise OR combination of the data available flags."]
32788 pub flags: UtmDataAvailFlags,
32789}
32790impl UTM_GLOBAL_POSITION_DATA {
32791 pub const ENCODED_LEN: usize = 70usize;
32792 pub const DEFAULT: Self = Self {
32793 time: 0_u64,
32794 lat: 0_i32,
32795 lon: 0_i32,
32796 alt: 0_i32,
32797 relative_alt: 0_i32,
32798 next_lat: 0_i32,
32799 next_lon: 0_i32,
32800 next_alt: 0_i32,
32801 vx: 0_i16,
32802 vy: 0_i16,
32803 vz: 0_i16,
32804 h_acc: 0_u16,
32805 v_acc: 0_u16,
32806 vel_acc: 0_u16,
32807 update_rate: 0_u16,
32808 uas_id: [0_u8; 18usize],
32809 flight_state: UtmFlightState::DEFAULT,
32810 flags: UtmDataAvailFlags::DEFAULT,
32811 };
32812 #[cfg(feature = "arbitrary")]
32813 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32814 use arbitrary::{Arbitrary, Unstructured};
32815 let mut buf = [0u8; 1024];
32816 rng.fill_bytes(&mut buf);
32817 let mut unstructured = Unstructured::new(&buf);
32818 Self::arbitrary(&mut unstructured).unwrap_or_default()
32819 }
32820}
32821impl Default for UTM_GLOBAL_POSITION_DATA {
32822 fn default() -> Self {
32823 Self::DEFAULT.clone()
32824 }
32825}
32826impl MessageData for UTM_GLOBAL_POSITION_DATA {
32827 type Message = MavMessage;
32828 const ID: u32 = 340u32;
32829 const NAME: &'static str = "UTM_GLOBAL_POSITION";
32830 const EXTRA_CRC: u8 = 99u8;
32831 const ENCODED_LEN: usize = 70usize;
32832 fn deser(
32833 _version: MavlinkVersion,
32834 __input: &[u8],
32835 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32836 let avail_len = __input.len();
32837 let mut payload_buf = [0; Self::ENCODED_LEN];
32838 let mut buf = if avail_len < Self::ENCODED_LEN {
32839 payload_buf[0..avail_len].copy_from_slice(__input);
32840 Bytes::new(&payload_buf)
32841 } else {
32842 Bytes::new(__input)
32843 };
32844 let mut __struct = Self::default();
32845 __struct.time = buf.get_u64_le()?;
32846 __struct.lat = buf.get_i32_le()?;
32847 __struct.lon = buf.get_i32_le()?;
32848 __struct.alt = buf.get_i32_le()?;
32849 __struct.relative_alt = buf.get_i32_le()?;
32850 __struct.next_lat = buf.get_i32_le()?;
32851 __struct.next_lon = buf.get_i32_le()?;
32852 __struct.next_alt = buf.get_i32_le()?;
32853 __struct.vx = buf.get_i16_le()?;
32854 __struct.vy = buf.get_i16_le()?;
32855 __struct.vz = buf.get_i16_le()?;
32856 __struct.h_acc = buf.get_u16_le()?;
32857 __struct.v_acc = buf.get_u16_le()?;
32858 __struct.vel_acc = buf.get_u16_le()?;
32859 __struct.update_rate = buf.get_u16_le()?;
32860 for v in &mut __struct.uas_id {
32861 let val = buf.get_u8()?;
32862 *v = val;
32863 }
32864 let tmp = buf.get_u8()?;
32865 __struct.flight_state =
32866 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32867 enum_type: "UtmFlightState",
32868 value: tmp as u64,
32869 })?;
32870 let tmp = buf.get_u8()?;
32871 __struct.flags = UtmDataAvailFlags::from_bits(tmp as <UtmDataAvailFlags as Flags>::Bits)
32872 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32873 flag_type: "UtmDataAvailFlags",
32874 value: tmp as u64,
32875 })?;
32876 Ok(__struct)
32877 }
32878 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32879 let mut __tmp = BytesMut::new(bytes);
32880 #[allow(clippy::absurd_extreme_comparisons)]
32881 #[allow(unused_comparisons)]
32882 if __tmp.remaining() < Self::ENCODED_LEN {
32883 panic!(
32884 "buffer is too small (need {} bytes, but got {})",
32885 Self::ENCODED_LEN,
32886 __tmp.remaining(),
32887 )
32888 }
32889 __tmp.put_u64_le(self.time);
32890 __tmp.put_i32_le(self.lat);
32891 __tmp.put_i32_le(self.lon);
32892 __tmp.put_i32_le(self.alt);
32893 __tmp.put_i32_le(self.relative_alt);
32894 __tmp.put_i32_le(self.next_lat);
32895 __tmp.put_i32_le(self.next_lon);
32896 __tmp.put_i32_le(self.next_alt);
32897 __tmp.put_i16_le(self.vx);
32898 __tmp.put_i16_le(self.vy);
32899 __tmp.put_i16_le(self.vz);
32900 __tmp.put_u16_le(self.h_acc);
32901 __tmp.put_u16_le(self.v_acc);
32902 __tmp.put_u16_le(self.vel_acc);
32903 __tmp.put_u16_le(self.update_rate);
32904 for val in &self.uas_id {
32905 __tmp.put_u8(*val);
32906 }
32907 __tmp.put_u8(self.flight_state as u8);
32908 __tmp.put_u8(self.flags.bits() as u8);
32909 if matches!(version, MavlinkVersion::V2) {
32910 let len = __tmp.len();
32911 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32912 } else {
32913 __tmp.len()
32914 }
32915 }
32916}
32917#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
32918#[doc = ""]
32919#[doc = "ID: 248"]
32920#[derive(Debug, Clone, PartialEq)]
32921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32922#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32923#[cfg_attr(feature = "ts", derive(TS))]
32924#[cfg_attr(feature = "ts", ts(export))]
32925pub struct V2_EXTENSION_DATA {
32926 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
32927 pub message_type: u16,
32928 #[doc = "Network ID (0 for broadcast)"]
32929 pub target_network: u8,
32930 #[doc = "System ID (0 for broadcast)"]
32931 pub target_system: u8,
32932 #[doc = "Component ID (0 for broadcast)"]
32933 pub target_component: u8,
32934 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
32935 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32936 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32937 pub payload: [u8; 249],
32938}
32939impl V2_EXTENSION_DATA {
32940 pub const ENCODED_LEN: usize = 254usize;
32941 pub const DEFAULT: Self = Self {
32942 message_type: 0_u16,
32943 target_network: 0_u8,
32944 target_system: 0_u8,
32945 target_component: 0_u8,
32946 payload: [0_u8; 249usize],
32947 };
32948 #[cfg(feature = "arbitrary")]
32949 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32950 use arbitrary::{Arbitrary, Unstructured};
32951 let mut buf = [0u8; 1024];
32952 rng.fill_bytes(&mut buf);
32953 let mut unstructured = Unstructured::new(&buf);
32954 Self::arbitrary(&mut unstructured).unwrap_or_default()
32955 }
32956}
32957impl Default for V2_EXTENSION_DATA {
32958 fn default() -> Self {
32959 Self::DEFAULT.clone()
32960 }
32961}
32962impl MessageData for V2_EXTENSION_DATA {
32963 type Message = MavMessage;
32964 const ID: u32 = 248u32;
32965 const NAME: &'static str = "V2_EXTENSION";
32966 const EXTRA_CRC: u8 = 8u8;
32967 const ENCODED_LEN: usize = 254usize;
32968 fn deser(
32969 _version: MavlinkVersion,
32970 __input: &[u8],
32971 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32972 let avail_len = __input.len();
32973 let mut payload_buf = [0; Self::ENCODED_LEN];
32974 let mut buf = if avail_len < Self::ENCODED_LEN {
32975 payload_buf[0..avail_len].copy_from_slice(__input);
32976 Bytes::new(&payload_buf)
32977 } else {
32978 Bytes::new(__input)
32979 };
32980 let mut __struct = Self::default();
32981 __struct.message_type = buf.get_u16_le()?;
32982 __struct.target_network = buf.get_u8()?;
32983 __struct.target_system = buf.get_u8()?;
32984 __struct.target_component = buf.get_u8()?;
32985 for v in &mut __struct.payload {
32986 let val = buf.get_u8()?;
32987 *v = val;
32988 }
32989 Ok(__struct)
32990 }
32991 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32992 let mut __tmp = BytesMut::new(bytes);
32993 #[allow(clippy::absurd_extreme_comparisons)]
32994 #[allow(unused_comparisons)]
32995 if __tmp.remaining() < Self::ENCODED_LEN {
32996 panic!(
32997 "buffer is too small (need {} bytes, but got {})",
32998 Self::ENCODED_LEN,
32999 __tmp.remaining(),
33000 )
33001 }
33002 __tmp.put_u16_le(self.message_type);
33003 __tmp.put_u8(self.target_network);
33004 __tmp.put_u8(self.target_system);
33005 __tmp.put_u8(self.target_component);
33006 for val in &self.payload {
33007 __tmp.put_u8(*val);
33008 }
33009 if matches!(version, MavlinkVersion::V2) {
33010 let len = __tmp.len();
33011 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33012 } else {
33013 __tmp.len()
33014 }
33015 }
33016}
33017#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
33018#[doc = ""]
33019#[doc = "ID: 74"]
33020#[derive(Debug, Clone, PartialEq)]
33021#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33022#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33023#[cfg_attr(feature = "ts", derive(TS))]
33024#[cfg_attr(feature = "ts", ts(export))]
33025pub struct VFR_HUD_DATA {
33026 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
33027 pub airspeed: f32,
33028 #[doc = "Current ground speed."]
33029 pub groundspeed: f32,
33030 #[doc = "Current altitude (MSL)."]
33031 pub alt: f32,
33032 #[doc = "Current climb rate."]
33033 pub climb: f32,
33034 #[doc = "Current heading in compass units (0-360, 0=north)."]
33035 pub heading: i16,
33036 #[doc = "Current throttle setting (0 to 100)."]
33037 pub throttle: u16,
33038}
33039impl VFR_HUD_DATA {
33040 pub const ENCODED_LEN: usize = 20usize;
33041 pub const DEFAULT: Self = Self {
33042 airspeed: 0.0_f32,
33043 groundspeed: 0.0_f32,
33044 alt: 0.0_f32,
33045 climb: 0.0_f32,
33046 heading: 0_i16,
33047 throttle: 0_u16,
33048 };
33049 #[cfg(feature = "arbitrary")]
33050 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33051 use arbitrary::{Arbitrary, Unstructured};
33052 let mut buf = [0u8; 1024];
33053 rng.fill_bytes(&mut buf);
33054 let mut unstructured = Unstructured::new(&buf);
33055 Self::arbitrary(&mut unstructured).unwrap_or_default()
33056 }
33057}
33058impl Default for VFR_HUD_DATA {
33059 fn default() -> Self {
33060 Self::DEFAULT.clone()
33061 }
33062}
33063impl MessageData for VFR_HUD_DATA {
33064 type Message = MavMessage;
33065 const ID: u32 = 74u32;
33066 const NAME: &'static str = "VFR_HUD";
33067 const EXTRA_CRC: u8 = 20u8;
33068 const ENCODED_LEN: usize = 20usize;
33069 fn deser(
33070 _version: MavlinkVersion,
33071 __input: &[u8],
33072 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33073 let avail_len = __input.len();
33074 let mut payload_buf = [0; Self::ENCODED_LEN];
33075 let mut buf = if avail_len < Self::ENCODED_LEN {
33076 payload_buf[0..avail_len].copy_from_slice(__input);
33077 Bytes::new(&payload_buf)
33078 } else {
33079 Bytes::new(__input)
33080 };
33081 let mut __struct = Self::default();
33082 __struct.airspeed = buf.get_f32_le()?;
33083 __struct.groundspeed = buf.get_f32_le()?;
33084 __struct.alt = buf.get_f32_le()?;
33085 __struct.climb = buf.get_f32_le()?;
33086 __struct.heading = buf.get_i16_le()?;
33087 __struct.throttle = buf.get_u16_le()?;
33088 Ok(__struct)
33089 }
33090 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33091 let mut __tmp = BytesMut::new(bytes);
33092 #[allow(clippy::absurd_extreme_comparisons)]
33093 #[allow(unused_comparisons)]
33094 if __tmp.remaining() < Self::ENCODED_LEN {
33095 panic!(
33096 "buffer is too small (need {} bytes, but got {})",
33097 Self::ENCODED_LEN,
33098 __tmp.remaining(),
33099 )
33100 }
33101 __tmp.put_f32_le(self.airspeed);
33102 __tmp.put_f32_le(self.groundspeed);
33103 __tmp.put_f32_le(self.alt);
33104 __tmp.put_f32_le(self.climb);
33105 __tmp.put_i16_le(self.heading);
33106 __tmp.put_u16_le(self.throttle);
33107 if matches!(version, MavlinkVersion::V2) {
33108 let len = __tmp.len();
33109 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33110 } else {
33111 __tmp.len()
33112 }
33113 }
33114}
33115#[doc = "Vibration levels and accelerometer clipping."]
33116#[doc = ""]
33117#[doc = "ID: 241"]
33118#[derive(Debug, Clone, PartialEq)]
33119#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33120#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33121#[cfg_attr(feature = "ts", derive(TS))]
33122#[cfg_attr(feature = "ts", ts(export))]
33123pub struct VIBRATION_DATA {
33124 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
33125 pub time_usec: u64,
33126 #[doc = "Vibration levels on X-axis"]
33127 pub vibration_x: f32,
33128 #[doc = "Vibration levels on Y-axis"]
33129 pub vibration_y: f32,
33130 #[doc = "Vibration levels on Z-axis"]
33131 pub vibration_z: f32,
33132 #[doc = "first accelerometer clipping count"]
33133 pub clipping_0: u32,
33134 #[doc = "second accelerometer clipping count"]
33135 pub clipping_1: u32,
33136 #[doc = "third accelerometer clipping count"]
33137 pub clipping_2: u32,
33138}
33139impl VIBRATION_DATA {
33140 pub const ENCODED_LEN: usize = 32usize;
33141 pub const DEFAULT: Self = Self {
33142 time_usec: 0_u64,
33143 vibration_x: 0.0_f32,
33144 vibration_y: 0.0_f32,
33145 vibration_z: 0.0_f32,
33146 clipping_0: 0_u32,
33147 clipping_1: 0_u32,
33148 clipping_2: 0_u32,
33149 };
33150 #[cfg(feature = "arbitrary")]
33151 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33152 use arbitrary::{Arbitrary, Unstructured};
33153 let mut buf = [0u8; 1024];
33154 rng.fill_bytes(&mut buf);
33155 let mut unstructured = Unstructured::new(&buf);
33156 Self::arbitrary(&mut unstructured).unwrap_or_default()
33157 }
33158}
33159impl Default for VIBRATION_DATA {
33160 fn default() -> Self {
33161 Self::DEFAULT.clone()
33162 }
33163}
33164impl MessageData for VIBRATION_DATA {
33165 type Message = MavMessage;
33166 const ID: u32 = 241u32;
33167 const NAME: &'static str = "VIBRATION";
33168 const EXTRA_CRC: u8 = 90u8;
33169 const ENCODED_LEN: usize = 32usize;
33170 fn deser(
33171 _version: MavlinkVersion,
33172 __input: &[u8],
33173 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33174 let avail_len = __input.len();
33175 let mut payload_buf = [0; Self::ENCODED_LEN];
33176 let mut buf = if avail_len < Self::ENCODED_LEN {
33177 payload_buf[0..avail_len].copy_from_slice(__input);
33178 Bytes::new(&payload_buf)
33179 } else {
33180 Bytes::new(__input)
33181 };
33182 let mut __struct = Self::default();
33183 __struct.time_usec = buf.get_u64_le()?;
33184 __struct.vibration_x = buf.get_f32_le()?;
33185 __struct.vibration_y = buf.get_f32_le()?;
33186 __struct.vibration_z = buf.get_f32_le()?;
33187 __struct.clipping_0 = buf.get_u32_le()?;
33188 __struct.clipping_1 = buf.get_u32_le()?;
33189 __struct.clipping_2 = buf.get_u32_le()?;
33190 Ok(__struct)
33191 }
33192 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33193 let mut __tmp = BytesMut::new(bytes);
33194 #[allow(clippy::absurd_extreme_comparisons)]
33195 #[allow(unused_comparisons)]
33196 if __tmp.remaining() < Self::ENCODED_LEN {
33197 panic!(
33198 "buffer is too small (need {} bytes, but got {})",
33199 Self::ENCODED_LEN,
33200 __tmp.remaining(),
33201 )
33202 }
33203 __tmp.put_u64_le(self.time_usec);
33204 __tmp.put_f32_le(self.vibration_x);
33205 __tmp.put_f32_le(self.vibration_y);
33206 __tmp.put_f32_le(self.vibration_z);
33207 __tmp.put_u32_le(self.clipping_0);
33208 __tmp.put_u32_le(self.clipping_1);
33209 __tmp.put_u32_le(self.clipping_2);
33210 if matches!(version, MavlinkVersion::V2) {
33211 let len = __tmp.len();
33212 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33213 } else {
33214 __tmp.len()
33215 }
33216 }
33217}
33218#[doc = "Global position estimate from a Vicon motion system source."]
33219#[doc = ""]
33220#[doc = "ID: 104"]
33221#[derive(Debug, Clone, PartialEq)]
33222#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33223#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33224#[cfg_attr(feature = "ts", derive(TS))]
33225#[cfg_attr(feature = "ts", ts(export))]
33226pub struct VICON_POSITION_ESTIMATE_DATA {
33227 #[doc = "Timestamp (UNIX time or time since system boot)"]
33228 pub usec: u64,
33229 #[doc = "Global X position"]
33230 pub x: f32,
33231 #[doc = "Global Y position"]
33232 pub y: f32,
33233 #[doc = "Global Z position"]
33234 pub z: f32,
33235 #[doc = "Roll angle"]
33236 pub roll: f32,
33237 #[doc = "Pitch angle"]
33238 pub pitch: f32,
33239 #[doc = "Yaw angle"]
33240 pub yaw: f32,
33241 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
33242 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33243 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33244 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33245 pub covariance: [f32; 21],
33246}
33247impl VICON_POSITION_ESTIMATE_DATA {
33248 pub const ENCODED_LEN: usize = 116usize;
33249 pub const DEFAULT: Self = Self {
33250 usec: 0_u64,
33251 x: 0.0_f32,
33252 y: 0.0_f32,
33253 z: 0.0_f32,
33254 roll: 0.0_f32,
33255 pitch: 0.0_f32,
33256 yaw: 0.0_f32,
33257 covariance: [0.0_f32; 21usize],
33258 };
33259 #[cfg(feature = "arbitrary")]
33260 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33261 use arbitrary::{Arbitrary, Unstructured};
33262 let mut buf = [0u8; 1024];
33263 rng.fill_bytes(&mut buf);
33264 let mut unstructured = Unstructured::new(&buf);
33265 Self::arbitrary(&mut unstructured).unwrap_or_default()
33266 }
33267}
33268impl Default for VICON_POSITION_ESTIMATE_DATA {
33269 fn default() -> Self {
33270 Self::DEFAULT.clone()
33271 }
33272}
33273impl MessageData for VICON_POSITION_ESTIMATE_DATA {
33274 type Message = MavMessage;
33275 const ID: u32 = 104u32;
33276 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
33277 const EXTRA_CRC: u8 = 56u8;
33278 const ENCODED_LEN: usize = 116usize;
33279 fn deser(
33280 _version: MavlinkVersion,
33281 __input: &[u8],
33282 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33283 let avail_len = __input.len();
33284 let mut payload_buf = [0; Self::ENCODED_LEN];
33285 let mut buf = if avail_len < Self::ENCODED_LEN {
33286 payload_buf[0..avail_len].copy_from_slice(__input);
33287 Bytes::new(&payload_buf)
33288 } else {
33289 Bytes::new(__input)
33290 };
33291 let mut __struct = Self::default();
33292 __struct.usec = buf.get_u64_le()?;
33293 __struct.x = buf.get_f32_le()?;
33294 __struct.y = buf.get_f32_le()?;
33295 __struct.z = buf.get_f32_le()?;
33296 __struct.roll = buf.get_f32_le()?;
33297 __struct.pitch = buf.get_f32_le()?;
33298 __struct.yaw = buf.get_f32_le()?;
33299 for v in &mut __struct.covariance {
33300 let val = buf.get_f32_le()?;
33301 *v = val;
33302 }
33303 Ok(__struct)
33304 }
33305 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33306 let mut __tmp = BytesMut::new(bytes);
33307 #[allow(clippy::absurd_extreme_comparisons)]
33308 #[allow(unused_comparisons)]
33309 if __tmp.remaining() < Self::ENCODED_LEN {
33310 panic!(
33311 "buffer is too small (need {} bytes, but got {})",
33312 Self::ENCODED_LEN,
33313 __tmp.remaining(),
33314 )
33315 }
33316 __tmp.put_u64_le(self.usec);
33317 __tmp.put_f32_le(self.x);
33318 __tmp.put_f32_le(self.y);
33319 __tmp.put_f32_le(self.z);
33320 __tmp.put_f32_le(self.roll);
33321 __tmp.put_f32_le(self.pitch);
33322 __tmp.put_f32_le(self.yaw);
33323 if matches!(version, MavlinkVersion::V2) {
33324 for val in &self.covariance {
33325 __tmp.put_f32_le(*val);
33326 }
33327 let len = __tmp.len();
33328 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33329 } else {
33330 __tmp.len()
33331 }
33332 }
33333}
33334#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
33335#[doc = ""]
33336#[doc = "ID: 269"]
33337#[derive(Debug, Clone, PartialEq)]
33338#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33340#[cfg_attr(feature = "ts", derive(TS))]
33341#[cfg_attr(feature = "ts", ts(export))]
33342pub struct VIDEO_STREAM_INFORMATION_DATA {
33343 #[doc = "Frame rate."]
33344 pub framerate: f32,
33345 #[doc = "Bit rate."]
33346 pub bitrate: u32,
33347 #[doc = "Bitmap of stream status flags."]
33348 pub flags: VideoStreamStatusFlags,
33349 #[doc = "Horizontal resolution."]
33350 pub resolution_h: u16,
33351 #[doc = "Vertical resolution."]
33352 pub resolution_v: u16,
33353 #[doc = "Video image rotation clockwise."]
33354 pub rotation: u16,
33355 #[doc = "Horizontal Field of view."]
33356 pub hfov: u16,
33357 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
33358 pub stream_id: u8,
33359 #[doc = "Number of streams available."]
33360 pub count: u8,
33361 #[doc = "Type of stream."]
33362 pub mavtype: VideoStreamType,
33363 #[doc = "Stream name."]
33364 #[cfg_attr(feature = "ts", ts(type = "string"))]
33365 pub name: CharArray<32>,
33366 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
33367 #[cfg_attr(feature = "ts", ts(type = "string"))]
33368 pub uri: CharArray<160>,
33369 #[doc = "Encoding of stream."]
33370 #[cfg_attr(feature = "serde", serde(default))]
33371 pub encoding: VideoStreamEncoding,
33372 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
33373 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33374 pub camera_device_id: u8,
33375}
33376impl VIDEO_STREAM_INFORMATION_DATA {
33377 pub const ENCODED_LEN: usize = 215usize;
33378 pub const DEFAULT: Self = Self {
33379 framerate: 0.0_f32,
33380 bitrate: 0_u32,
33381 flags: VideoStreamStatusFlags::DEFAULT,
33382 resolution_h: 0_u16,
33383 resolution_v: 0_u16,
33384 rotation: 0_u16,
33385 hfov: 0_u16,
33386 stream_id: 0_u8,
33387 count: 0_u8,
33388 mavtype: VideoStreamType::DEFAULT,
33389 name: CharArray::new([0_u8; 32usize]),
33390 uri: CharArray::new([0_u8; 160usize]),
33391 encoding: VideoStreamEncoding::DEFAULT,
33392 camera_device_id: 0_u8,
33393 };
33394 #[cfg(feature = "arbitrary")]
33395 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33396 use arbitrary::{Arbitrary, Unstructured};
33397 let mut buf = [0u8; 1024];
33398 rng.fill_bytes(&mut buf);
33399 let mut unstructured = Unstructured::new(&buf);
33400 Self::arbitrary(&mut unstructured).unwrap_or_default()
33401 }
33402}
33403impl Default for VIDEO_STREAM_INFORMATION_DATA {
33404 fn default() -> Self {
33405 Self::DEFAULT.clone()
33406 }
33407}
33408impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
33409 type Message = MavMessage;
33410 const ID: u32 = 269u32;
33411 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
33412 const EXTRA_CRC: u8 = 109u8;
33413 const ENCODED_LEN: usize = 215usize;
33414 fn deser(
33415 _version: MavlinkVersion,
33416 __input: &[u8],
33417 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33418 let avail_len = __input.len();
33419 let mut payload_buf = [0; Self::ENCODED_LEN];
33420 let mut buf = if avail_len < Self::ENCODED_LEN {
33421 payload_buf[0..avail_len].copy_from_slice(__input);
33422 Bytes::new(&payload_buf)
33423 } else {
33424 Bytes::new(__input)
33425 };
33426 let mut __struct = Self::default();
33427 __struct.framerate = buf.get_f32_le()?;
33428 __struct.bitrate = buf.get_u32_le()?;
33429 let tmp = buf.get_u16_le()?;
33430 __struct.flags =
33431 VideoStreamStatusFlags::from_bits(tmp as <VideoStreamStatusFlags as Flags>::Bits)
33432 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
33433 flag_type: "VideoStreamStatusFlags",
33434 value: tmp as u64,
33435 })?;
33436 __struct.resolution_h = buf.get_u16_le()?;
33437 __struct.resolution_v = buf.get_u16_le()?;
33438 __struct.rotation = buf.get_u16_le()?;
33439 __struct.hfov = buf.get_u16_le()?;
33440 __struct.stream_id = buf.get_u8()?;
33441 __struct.count = buf.get_u8()?;
33442 let tmp = buf.get_u8()?;
33443 __struct.mavtype =
33444 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
33445 enum_type: "VideoStreamType",
33446 value: tmp as u64,
33447 })?;
33448 let mut tmp = [0_u8; 32usize];
33449 for v in &mut tmp {
33450 *v = buf.get_u8()?;
33451 }
33452 __struct.name = CharArray::new(tmp);
33453 let mut tmp = [0_u8; 160usize];
33454 for v in &mut tmp {
33455 *v = buf.get_u8()?;
33456 }
33457 __struct.uri = CharArray::new(tmp);
33458 let tmp = buf.get_u8()?;
33459 __struct.encoding =
33460 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
33461 enum_type: "VideoStreamEncoding",
33462 value: tmp as u64,
33463 })?;
33464 __struct.camera_device_id = buf.get_u8()?;
33465 Ok(__struct)
33466 }
33467 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33468 let mut __tmp = BytesMut::new(bytes);
33469 #[allow(clippy::absurd_extreme_comparisons)]
33470 #[allow(unused_comparisons)]
33471 if __tmp.remaining() < Self::ENCODED_LEN {
33472 panic!(
33473 "buffer is too small (need {} bytes, but got {})",
33474 Self::ENCODED_LEN,
33475 __tmp.remaining(),
33476 )
33477 }
33478 __tmp.put_f32_le(self.framerate);
33479 __tmp.put_u32_le(self.bitrate);
33480 __tmp.put_u16_le(self.flags.bits() as u16);
33481 __tmp.put_u16_le(self.resolution_h);
33482 __tmp.put_u16_le(self.resolution_v);
33483 __tmp.put_u16_le(self.rotation);
33484 __tmp.put_u16_le(self.hfov);
33485 __tmp.put_u8(self.stream_id);
33486 __tmp.put_u8(self.count);
33487 __tmp.put_u8(self.mavtype as u8);
33488 for val in &self.name {
33489 __tmp.put_u8(*val);
33490 }
33491 for val in &self.uri {
33492 __tmp.put_u8(*val);
33493 }
33494 if matches!(version, MavlinkVersion::V2) {
33495 __tmp.put_u8(self.encoding as u8);
33496 __tmp.put_u8(self.camera_device_id);
33497 let len = __tmp.len();
33498 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33499 } else {
33500 __tmp.len()
33501 }
33502 }
33503}
33504#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
33505#[doc = ""]
33506#[doc = "ID: 270"]
33507#[derive(Debug, Clone, PartialEq)]
33508#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33509#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33510#[cfg_attr(feature = "ts", derive(TS))]
33511#[cfg_attr(feature = "ts", ts(export))]
33512pub struct VIDEO_STREAM_STATUS_DATA {
33513 #[doc = "Frame rate"]
33514 pub framerate: f32,
33515 #[doc = "Bit rate"]
33516 pub bitrate: u32,
33517 #[doc = "Bitmap of stream status flags"]
33518 pub flags: VideoStreamStatusFlags,
33519 #[doc = "Horizontal resolution"]
33520 pub resolution_h: u16,
33521 #[doc = "Vertical resolution"]
33522 pub resolution_v: u16,
33523 #[doc = "Video image rotation clockwise"]
33524 pub rotation: u16,
33525 #[doc = "Horizontal Field of view"]
33526 pub hfov: u16,
33527 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
33528 pub stream_id: u8,
33529 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
33530 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33531 pub camera_device_id: u8,
33532}
33533impl VIDEO_STREAM_STATUS_DATA {
33534 pub const ENCODED_LEN: usize = 20usize;
33535 pub const DEFAULT: Self = Self {
33536 framerate: 0.0_f32,
33537 bitrate: 0_u32,
33538 flags: VideoStreamStatusFlags::DEFAULT,
33539 resolution_h: 0_u16,
33540 resolution_v: 0_u16,
33541 rotation: 0_u16,
33542 hfov: 0_u16,
33543 stream_id: 0_u8,
33544 camera_device_id: 0_u8,
33545 };
33546 #[cfg(feature = "arbitrary")]
33547 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33548 use arbitrary::{Arbitrary, Unstructured};
33549 let mut buf = [0u8; 1024];
33550 rng.fill_bytes(&mut buf);
33551 let mut unstructured = Unstructured::new(&buf);
33552 Self::arbitrary(&mut unstructured).unwrap_or_default()
33553 }
33554}
33555impl Default for VIDEO_STREAM_STATUS_DATA {
33556 fn default() -> Self {
33557 Self::DEFAULT.clone()
33558 }
33559}
33560impl MessageData for VIDEO_STREAM_STATUS_DATA {
33561 type Message = MavMessage;
33562 const ID: u32 = 270u32;
33563 const NAME: &'static str = "VIDEO_STREAM_STATUS";
33564 const EXTRA_CRC: u8 = 59u8;
33565 const ENCODED_LEN: usize = 20usize;
33566 fn deser(
33567 _version: MavlinkVersion,
33568 __input: &[u8],
33569 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33570 let avail_len = __input.len();
33571 let mut payload_buf = [0; Self::ENCODED_LEN];
33572 let mut buf = if avail_len < Self::ENCODED_LEN {
33573 payload_buf[0..avail_len].copy_from_slice(__input);
33574 Bytes::new(&payload_buf)
33575 } else {
33576 Bytes::new(__input)
33577 };
33578 let mut __struct = Self::default();
33579 __struct.framerate = buf.get_f32_le()?;
33580 __struct.bitrate = buf.get_u32_le()?;
33581 let tmp = buf.get_u16_le()?;
33582 __struct.flags =
33583 VideoStreamStatusFlags::from_bits(tmp as <VideoStreamStatusFlags as Flags>::Bits)
33584 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
33585 flag_type: "VideoStreamStatusFlags",
33586 value: tmp as u64,
33587 })?;
33588 __struct.resolution_h = buf.get_u16_le()?;
33589 __struct.resolution_v = buf.get_u16_le()?;
33590 __struct.rotation = buf.get_u16_le()?;
33591 __struct.hfov = buf.get_u16_le()?;
33592 __struct.stream_id = buf.get_u8()?;
33593 __struct.camera_device_id = buf.get_u8()?;
33594 Ok(__struct)
33595 }
33596 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33597 let mut __tmp = BytesMut::new(bytes);
33598 #[allow(clippy::absurd_extreme_comparisons)]
33599 #[allow(unused_comparisons)]
33600 if __tmp.remaining() < Self::ENCODED_LEN {
33601 panic!(
33602 "buffer is too small (need {} bytes, but got {})",
33603 Self::ENCODED_LEN,
33604 __tmp.remaining(),
33605 )
33606 }
33607 __tmp.put_f32_le(self.framerate);
33608 __tmp.put_u32_le(self.bitrate);
33609 __tmp.put_u16_le(self.flags.bits() as u16);
33610 __tmp.put_u16_le(self.resolution_h);
33611 __tmp.put_u16_le(self.resolution_v);
33612 __tmp.put_u16_le(self.rotation);
33613 __tmp.put_u16_le(self.hfov);
33614 __tmp.put_u8(self.stream_id);
33615 if matches!(version, MavlinkVersion::V2) {
33616 __tmp.put_u8(self.camera_device_id);
33617 let len = __tmp.len();
33618 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33619 } else {
33620 __tmp.len()
33621 }
33622 }
33623}
33624#[doc = "Local position/attitude estimate from a vision source."]
33625#[doc = ""]
33626#[doc = "ID: 102"]
33627#[derive(Debug, Clone, PartialEq)]
33628#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33629#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33630#[cfg_attr(feature = "ts", derive(TS))]
33631#[cfg_attr(feature = "ts", ts(export))]
33632pub struct VISION_POSITION_ESTIMATE_DATA {
33633 #[doc = "Timestamp (UNIX time or time since system boot)"]
33634 pub usec: u64,
33635 #[doc = "Local X position"]
33636 pub x: f32,
33637 #[doc = "Local Y position"]
33638 pub y: f32,
33639 #[doc = "Local Z position"]
33640 pub z: f32,
33641 #[doc = "Roll angle"]
33642 pub roll: f32,
33643 #[doc = "Pitch angle"]
33644 pub pitch: f32,
33645 #[doc = "Yaw angle"]
33646 pub yaw: f32,
33647 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
33648 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33649 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33650 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33651 pub covariance: [f32; 21],
33652 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
33653 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33654 pub reset_counter: u8,
33655}
33656impl VISION_POSITION_ESTIMATE_DATA {
33657 pub const ENCODED_LEN: usize = 117usize;
33658 pub const DEFAULT: Self = Self {
33659 usec: 0_u64,
33660 x: 0.0_f32,
33661 y: 0.0_f32,
33662 z: 0.0_f32,
33663 roll: 0.0_f32,
33664 pitch: 0.0_f32,
33665 yaw: 0.0_f32,
33666 covariance: [0.0_f32; 21usize],
33667 reset_counter: 0_u8,
33668 };
33669 #[cfg(feature = "arbitrary")]
33670 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33671 use arbitrary::{Arbitrary, Unstructured};
33672 let mut buf = [0u8; 1024];
33673 rng.fill_bytes(&mut buf);
33674 let mut unstructured = Unstructured::new(&buf);
33675 Self::arbitrary(&mut unstructured).unwrap_or_default()
33676 }
33677}
33678impl Default for VISION_POSITION_ESTIMATE_DATA {
33679 fn default() -> Self {
33680 Self::DEFAULT.clone()
33681 }
33682}
33683impl MessageData for VISION_POSITION_ESTIMATE_DATA {
33684 type Message = MavMessage;
33685 const ID: u32 = 102u32;
33686 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
33687 const EXTRA_CRC: u8 = 158u8;
33688 const ENCODED_LEN: usize = 117usize;
33689 fn deser(
33690 _version: MavlinkVersion,
33691 __input: &[u8],
33692 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33693 let avail_len = __input.len();
33694 let mut payload_buf = [0; Self::ENCODED_LEN];
33695 let mut buf = if avail_len < Self::ENCODED_LEN {
33696 payload_buf[0..avail_len].copy_from_slice(__input);
33697 Bytes::new(&payload_buf)
33698 } else {
33699 Bytes::new(__input)
33700 };
33701 let mut __struct = Self::default();
33702 __struct.usec = buf.get_u64_le()?;
33703 __struct.x = buf.get_f32_le()?;
33704 __struct.y = buf.get_f32_le()?;
33705 __struct.z = buf.get_f32_le()?;
33706 __struct.roll = buf.get_f32_le()?;
33707 __struct.pitch = buf.get_f32_le()?;
33708 __struct.yaw = buf.get_f32_le()?;
33709 for v in &mut __struct.covariance {
33710 let val = buf.get_f32_le()?;
33711 *v = val;
33712 }
33713 __struct.reset_counter = buf.get_u8()?;
33714 Ok(__struct)
33715 }
33716 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33717 let mut __tmp = BytesMut::new(bytes);
33718 #[allow(clippy::absurd_extreme_comparisons)]
33719 #[allow(unused_comparisons)]
33720 if __tmp.remaining() < Self::ENCODED_LEN {
33721 panic!(
33722 "buffer is too small (need {} bytes, but got {})",
33723 Self::ENCODED_LEN,
33724 __tmp.remaining(),
33725 )
33726 }
33727 __tmp.put_u64_le(self.usec);
33728 __tmp.put_f32_le(self.x);
33729 __tmp.put_f32_le(self.y);
33730 __tmp.put_f32_le(self.z);
33731 __tmp.put_f32_le(self.roll);
33732 __tmp.put_f32_le(self.pitch);
33733 __tmp.put_f32_le(self.yaw);
33734 if matches!(version, MavlinkVersion::V2) {
33735 for val in &self.covariance {
33736 __tmp.put_f32_le(*val);
33737 }
33738 __tmp.put_u8(self.reset_counter);
33739 let len = __tmp.len();
33740 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33741 } else {
33742 __tmp.len()
33743 }
33744 }
33745}
33746#[doc = "Speed estimate from a vision source."]
33747#[doc = ""]
33748#[doc = "ID: 103"]
33749#[derive(Debug, Clone, PartialEq)]
33750#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33751#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33752#[cfg_attr(feature = "ts", derive(TS))]
33753#[cfg_attr(feature = "ts", ts(export))]
33754pub struct VISION_SPEED_ESTIMATE_DATA {
33755 #[doc = "Timestamp (UNIX time or time since system boot)"]
33756 pub usec: u64,
33757 #[doc = "Global X speed"]
33758 pub x: f32,
33759 #[doc = "Global Y speed"]
33760 pub y: f32,
33761 #[doc = "Global Z speed"]
33762 pub z: f32,
33763 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
33764 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33765 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33766 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33767 pub covariance: [f32; 9],
33768 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
33769 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33770 pub reset_counter: u8,
33771}
33772impl VISION_SPEED_ESTIMATE_DATA {
33773 pub const ENCODED_LEN: usize = 57usize;
33774 pub const DEFAULT: Self = Self {
33775 usec: 0_u64,
33776 x: 0.0_f32,
33777 y: 0.0_f32,
33778 z: 0.0_f32,
33779 covariance: [0.0_f32; 9usize],
33780 reset_counter: 0_u8,
33781 };
33782 #[cfg(feature = "arbitrary")]
33783 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33784 use arbitrary::{Arbitrary, Unstructured};
33785 let mut buf = [0u8; 1024];
33786 rng.fill_bytes(&mut buf);
33787 let mut unstructured = Unstructured::new(&buf);
33788 Self::arbitrary(&mut unstructured).unwrap_or_default()
33789 }
33790}
33791impl Default for VISION_SPEED_ESTIMATE_DATA {
33792 fn default() -> Self {
33793 Self::DEFAULT.clone()
33794 }
33795}
33796impl MessageData for VISION_SPEED_ESTIMATE_DATA {
33797 type Message = MavMessage;
33798 const ID: u32 = 103u32;
33799 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
33800 const EXTRA_CRC: u8 = 208u8;
33801 const ENCODED_LEN: usize = 57usize;
33802 fn deser(
33803 _version: MavlinkVersion,
33804 __input: &[u8],
33805 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33806 let avail_len = __input.len();
33807 let mut payload_buf = [0; Self::ENCODED_LEN];
33808 let mut buf = if avail_len < Self::ENCODED_LEN {
33809 payload_buf[0..avail_len].copy_from_slice(__input);
33810 Bytes::new(&payload_buf)
33811 } else {
33812 Bytes::new(__input)
33813 };
33814 let mut __struct = Self::default();
33815 __struct.usec = buf.get_u64_le()?;
33816 __struct.x = buf.get_f32_le()?;
33817 __struct.y = buf.get_f32_le()?;
33818 __struct.z = buf.get_f32_le()?;
33819 for v in &mut __struct.covariance {
33820 let val = buf.get_f32_le()?;
33821 *v = val;
33822 }
33823 __struct.reset_counter = buf.get_u8()?;
33824 Ok(__struct)
33825 }
33826 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33827 let mut __tmp = BytesMut::new(bytes);
33828 #[allow(clippy::absurd_extreme_comparisons)]
33829 #[allow(unused_comparisons)]
33830 if __tmp.remaining() < Self::ENCODED_LEN {
33831 panic!(
33832 "buffer is too small (need {} bytes, but got {})",
33833 Self::ENCODED_LEN,
33834 __tmp.remaining(),
33835 )
33836 }
33837 __tmp.put_u64_le(self.usec);
33838 __tmp.put_f32_le(self.x);
33839 __tmp.put_f32_le(self.y);
33840 __tmp.put_f32_le(self.z);
33841 if matches!(version, MavlinkVersion::V2) {
33842 for val in &self.covariance {
33843 __tmp.put_f32_le(*val);
33844 }
33845 __tmp.put_u8(self.reset_counter);
33846 let len = __tmp.len();
33847 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33848 } else {
33849 __tmp.len()
33850 }
33851 }
33852}
33853#[doc = "Cumulative distance traveled for each reported wheel."]
33854#[doc = ""]
33855#[doc = "ID: 9000"]
33856#[derive(Debug, Clone, PartialEq)]
33857#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33858#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33859#[cfg_attr(feature = "ts", derive(TS))]
33860#[cfg_attr(feature = "ts", ts(export))]
33861pub struct WHEEL_DISTANCE_DATA {
33862 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
33863 pub time_usec: u64,
33864 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
33865 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33866 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33867 pub distance: [f64; 16],
33868 #[doc = "Number of wheels reported."]
33869 pub count: u8,
33870}
33871impl WHEEL_DISTANCE_DATA {
33872 pub const ENCODED_LEN: usize = 137usize;
33873 pub const DEFAULT: Self = Self {
33874 time_usec: 0_u64,
33875 distance: [0.0_f64; 16usize],
33876 count: 0_u8,
33877 };
33878 #[cfg(feature = "arbitrary")]
33879 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33880 use arbitrary::{Arbitrary, Unstructured};
33881 let mut buf = [0u8; 1024];
33882 rng.fill_bytes(&mut buf);
33883 let mut unstructured = Unstructured::new(&buf);
33884 Self::arbitrary(&mut unstructured).unwrap_or_default()
33885 }
33886}
33887impl Default for WHEEL_DISTANCE_DATA {
33888 fn default() -> Self {
33889 Self::DEFAULT.clone()
33890 }
33891}
33892impl MessageData for WHEEL_DISTANCE_DATA {
33893 type Message = MavMessage;
33894 const ID: u32 = 9000u32;
33895 const NAME: &'static str = "WHEEL_DISTANCE";
33896 const EXTRA_CRC: u8 = 113u8;
33897 const ENCODED_LEN: usize = 137usize;
33898 fn deser(
33899 _version: MavlinkVersion,
33900 __input: &[u8],
33901 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33902 let avail_len = __input.len();
33903 let mut payload_buf = [0; Self::ENCODED_LEN];
33904 let mut buf = if avail_len < Self::ENCODED_LEN {
33905 payload_buf[0..avail_len].copy_from_slice(__input);
33906 Bytes::new(&payload_buf)
33907 } else {
33908 Bytes::new(__input)
33909 };
33910 let mut __struct = Self::default();
33911 __struct.time_usec = buf.get_u64_le()?;
33912 for v in &mut __struct.distance {
33913 let val = buf.get_f64_le()?;
33914 *v = val;
33915 }
33916 __struct.count = buf.get_u8()?;
33917 Ok(__struct)
33918 }
33919 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33920 let mut __tmp = BytesMut::new(bytes);
33921 #[allow(clippy::absurd_extreme_comparisons)]
33922 #[allow(unused_comparisons)]
33923 if __tmp.remaining() < Self::ENCODED_LEN {
33924 panic!(
33925 "buffer is too small (need {} bytes, but got {})",
33926 Self::ENCODED_LEN,
33927 __tmp.remaining(),
33928 )
33929 }
33930 __tmp.put_u64_le(self.time_usec);
33931 for val in &self.distance {
33932 __tmp.put_f64_le(*val);
33933 }
33934 __tmp.put_u8(self.count);
33935 if matches!(version, MavlinkVersion::V2) {
33936 let len = __tmp.len();
33937 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33938 } else {
33939 __tmp.len()
33940 }
33941 }
33942}
33943#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33944#[doc = ""]
33945#[doc = "ID: 299"]
33946#[derive(Debug, Clone, PartialEq)]
33947#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33948#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33949#[cfg_attr(feature = "ts", derive(TS))]
33950#[cfg_attr(feature = "ts", ts(export))]
33951pub struct WIFI_CONFIG_AP_DATA {
33952 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
33953 #[cfg_attr(feature = "ts", ts(type = "string"))]
33954 pub ssid: CharArray<32>,
33955 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
33956 #[cfg_attr(feature = "ts", ts(type = "string"))]
33957 pub password: CharArray<64>,
33958 #[doc = "WiFi Mode."]
33959 #[cfg_attr(feature = "serde", serde(default))]
33960 pub mode: WifiConfigApMode,
33961 #[doc = "Message acceptance response (sent back to GS)."]
33962 #[cfg_attr(feature = "serde", serde(default))]
33963 pub response: WifiConfigApResponse,
33964}
33965impl WIFI_CONFIG_AP_DATA {
33966 pub const ENCODED_LEN: usize = 98usize;
33967 pub const DEFAULT: Self = Self {
33968 ssid: CharArray::new([0_u8; 32usize]),
33969 password: CharArray::new([0_u8; 64usize]),
33970 mode: WifiConfigApMode::DEFAULT,
33971 response: WifiConfigApResponse::DEFAULT,
33972 };
33973 #[cfg(feature = "arbitrary")]
33974 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33975 use arbitrary::{Arbitrary, Unstructured};
33976 let mut buf = [0u8; 1024];
33977 rng.fill_bytes(&mut buf);
33978 let mut unstructured = Unstructured::new(&buf);
33979 Self::arbitrary(&mut unstructured).unwrap_or_default()
33980 }
33981}
33982impl Default for WIFI_CONFIG_AP_DATA {
33983 fn default() -> Self {
33984 Self::DEFAULT.clone()
33985 }
33986}
33987impl MessageData for WIFI_CONFIG_AP_DATA {
33988 type Message = MavMessage;
33989 const ID: u32 = 299u32;
33990 const NAME: &'static str = "WIFI_CONFIG_AP";
33991 const EXTRA_CRC: u8 = 19u8;
33992 const ENCODED_LEN: usize = 98usize;
33993 fn deser(
33994 _version: MavlinkVersion,
33995 __input: &[u8],
33996 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33997 let avail_len = __input.len();
33998 let mut payload_buf = [0; Self::ENCODED_LEN];
33999 let mut buf = if avail_len < Self::ENCODED_LEN {
34000 payload_buf[0..avail_len].copy_from_slice(__input);
34001 Bytes::new(&payload_buf)
34002 } else {
34003 Bytes::new(__input)
34004 };
34005 let mut __struct = Self::default();
34006 let mut tmp = [0_u8; 32usize];
34007 for v in &mut tmp {
34008 *v = buf.get_u8()?;
34009 }
34010 __struct.ssid = CharArray::new(tmp);
34011 let mut tmp = [0_u8; 64usize];
34012 for v in &mut tmp {
34013 *v = buf.get_u8()?;
34014 }
34015 __struct.password = CharArray::new(tmp);
34016 let tmp = buf.get_i8()?;
34017 __struct.mode =
34018 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
34019 enum_type: "WifiConfigApMode",
34020 value: tmp as u64,
34021 })?;
34022 let tmp = buf.get_i8()?;
34023 __struct.response =
34024 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
34025 enum_type: "WifiConfigApResponse",
34026 value: tmp as u64,
34027 })?;
34028 Ok(__struct)
34029 }
34030 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34031 let mut __tmp = BytesMut::new(bytes);
34032 #[allow(clippy::absurd_extreme_comparisons)]
34033 #[allow(unused_comparisons)]
34034 if __tmp.remaining() < Self::ENCODED_LEN {
34035 panic!(
34036 "buffer is too small (need {} bytes, but got {})",
34037 Self::ENCODED_LEN,
34038 __tmp.remaining(),
34039 )
34040 }
34041 for val in &self.ssid {
34042 __tmp.put_u8(*val);
34043 }
34044 for val in &self.password {
34045 __tmp.put_u8(*val);
34046 }
34047 if matches!(version, MavlinkVersion::V2) {
34048 __tmp.put_i8(self.mode as i8);
34049 __tmp.put_i8(self.response as i8);
34050 let len = __tmp.len();
34051 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34052 } else {
34053 __tmp.len()
34054 }
34055 }
34056}
34057#[doc = "Winch status."]
34058#[doc = ""]
34059#[doc = "ID: 9005"]
34060#[derive(Debug, Clone, PartialEq)]
34061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34062#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34063#[cfg_attr(feature = "ts", derive(TS))]
34064#[cfg_attr(feature = "ts", ts(export))]
34065pub struct WINCH_STATUS_DATA {
34066 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
34067 pub time_usec: u64,
34068 #[doc = "Length of line released. NaN if unknown"]
34069 pub line_length: f32,
34070 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
34071 pub speed: f32,
34072 #[doc = "Tension on the line. NaN if unknown"]
34073 pub tension: f32,
34074 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
34075 pub voltage: f32,
34076 #[doc = "Current draw from the winch. NaN if unknown"]
34077 pub current: f32,
34078 #[doc = "Status flags"]
34079 pub status: MavWinchStatusFlag,
34080 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
34081 pub temperature: i16,
34082}
34083impl WINCH_STATUS_DATA {
34084 pub const ENCODED_LEN: usize = 34usize;
34085 pub const DEFAULT: Self = Self {
34086 time_usec: 0_u64,
34087 line_length: 0.0_f32,
34088 speed: 0.0_f32,
34089 tension: 0.0_f32,
34090 voltage: 0.0_f32,
34091 current: 0.0_f32,
34092 status: MavWinchStatusFlag::DEFAULT,
34093 temperature: 0_i16,
34094 };
34095 #[cfg(feature = "arbitrary")]
34096 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34097 use arbitrary::{Arbitrary, Unstructured};
34098 let mut buf = [0u8; 1024];
34099 rng.fill_bytes(&mut buf);
34100 let mut unstructured = Unstructured::new(&buf);
34101 Self::arbitrary(&mut unstructured).unwrap_or_default()
34102 }
34103}
34104impl Default for WINCH_STATUS_DATA {
34105 fn default() -> Self {
34106 Self::DEFAULT.clone()
34107 }
34108}
34109impl MessageData for WINCH_STATUS_DATA {
34110 type Message = MavMessage;
34111 const ID: u32 = 9005u32;
34112 const NAME: &'static str = "WINCH_STATUS";
34113 const EXTRA_CRC: u8 = 117u8;
34114 const ENCODED_LEN: usize = 34usize;
34115 fn deser(
34116 _version: MavlinkVersion,
34117 __input: &[u8],
34118 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34119 let avail_len = __input.len();
34120 let mut payload_buf = [0; Self::ENCODED_LEN];
34121 let mut buf = if avail_len < Self::ENCODED_LEN {
34122 payload_buf[0..avail_len].copy_from_slice(__input);
34123 Bytes::new(&payload_buf)
34124 } else {
34125 Bytes::new(__input)
34126 };
34127 let mut __struct = Self::default();
34128 __struct.time_usec = buf.get_u64_le()?;
34129 __struct.line_length = buf.get_f32_le()?;
34130 __struct.speed = buf.get_f32_le()?;
34131 __struct.tension = buf.get_f32_le()?;
34132 __struct.voltage = buf.get_f32_le()?;
34133 __struct.current = buf.get_f32_le()?;
34134 let tmp = buf.get_u32_le()?;
34135 __struct.status = MavWinchStatusFlag::from_bits(tmp as <MavWinchStatusFlag as Flags>::Bits)
34136 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
34137 flag_type: "MavWinchStatusFlag",
34138 value: tmp as u64,
34139 })?;
34140 __struct.temperature = buf.get_i16_le()?;
34141 Ok(__struct)
34142 }
34143 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34144 let mut __tmp = BytesMut::new(bytes);
34145 #[allow(clippy::absurd_extreme_comparisons)]
34146 #[allow(unused_comparisons)]
34147 if __tmp.remaining() < Self::ENCODED_LEN {
34148 panic!(
34149 "buffer is too small (need {} bytes, but got {})",
34150 Self::ENCODED_LEN,
34151 __tmp.remaining(),
34152 )
34153 }
34154 __tmp.put_u64_le(self.time_usec);
34155 __tmp.put_f32_le(self.line_length);
34156 __tmp.put_f32_le(self.speed);
34157 __tmp.put_f32_le(self.tension);
34158 __tmp.put_f32_le(self.voltage);
34159 __tmp.put_f32_le(self.current);
34160 __tmp.put_u32_le(self.status.bits() as u32);
34161 __tmp.put_i16_le(self.temperature);
34162 if matches!(version, MavlinkVersion::V2) {
34163 let len = __tmp.len();
34164 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34165 } else {
34166 __tmp.len()
34167 }
34168 }
34169}
34170#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
34171#[doc = ""]
34172#[doc = "ID: 231"]
34173#[derive(Debug, Clone, PartialEq)]
34174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34175#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34176#[cfg_attr(feature = "ts", derive(TS))]
34177#[cfg_attr(feature = "ts", ts(export))]
34178pub struct WIND_COV_DATA {
34179 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
34180 pub time_usec: u64,
34181 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
34182 pub wind_x: f32,
34183 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
34184 pub wind_y: f32,
34185 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
34186 pub wind_z: f32,
34187 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
34188 pub var_horiz: f32,
34189 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
34190 pub var_vert: f32,
34191 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
34192 pub wind_alt: f32,
34193 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
34194 pub horiz_accuracy: f32,
34195 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
34196 pub vert_accuracy: f32,
34197}
34198impl WIND_COV_DATA {
34199 pub const ENCODED_LEN: usize = 40usize;
34200 pub const DEFAULT: Self = Self {
34201 time_usec: 0_u64,
34202 wind_x: 0.0_f32,
34203 wind_y: 0.0_f32,
34204 wind_z: 0.0_f32,
34205 var_horiz: 0.0_f32,
34206 var_vert: 0.0_f32,
34207 wind_alt: 0.0_f32,
34208 horiz_accuracy: 0.0_f32,
34209 vert_accuracy: 0.0_f32,
34210 };
34211 #[cfg(feature = "arbitrary")]
34212 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34213 use arbitrary::{Arbitrary, Unstructured};
34214 let mut buf = [0u8; 1024];
34215 rng.fill_bytes(&mut buf);
34216 let mut unstructured = Unstructured::new(&buf);
34217 Self::arbitrary(&mut unstructured).unwrap_or_default()
34218 }
34219}
34220impl Default for WIND_COV_DATA {
34221 fn default() -> Self {
34222 Self::DEFAULT.clone()
34223 }
34224}
34225impl MessageData for WIND_COV_DATA {
34226 type Message = MavMessage;
34227 const ID: u32 = 231u32;
34228 const NAME: &'static str = "WIND_COV";
34229 const EXTRA_CRC: u8 = 105u8;
34230 const ENCODED_LEN: usize = 40usize;
34231 fn deser(
34232 _version: MavlinkVersion,
34233 __input: &[u8],
34234 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34235 let avail_len = __input.len();
34236 let mut payload_buf = [0; Self::ENCODED_LEN];
34237 let mut buf = if avail_len < Self::ENCODED_LEN {
34238 payload_buf[0..avail_len].copy_from_slice(__input);
34239 Bytes::new(&payload_buf)
34240 } else {
34241 Bytes::new(__input)
34242 };
34243 let mut __struct = Self::default();
34244 __struct.time_usec = buf.get_u64_le()?;
34245 __struct.wind_x = buf.get_f32_le()?;
34246 __struct.wind_y = buf.get_f32_le()?;
34247 __struct.wind_z = buf.get_f32_le()?;
34248 __struct.var_horiz = buf.get_f32_le()?;
34249 __struct.var_vert = buf.get_f32_le()?;
34250 __struct.wind_alt = buf.get_f32_le()?;
34251 __struct.horiz_accuracy = buf.get_f32_le()?;
34252 __struct.vert_accuracy = buf.get_f32_le()?;
34253 Ok(__struct)
34254 }
34255 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34256 let mut __tmp = BytesMut::new(bytes);
34257 #[allow(clippy::absurd_extreme_comparisons)]
34258 #[allow(unused_comparisons)]
34259 if __tmp.remaining() < Self::ENCODED_LEN {
34260 panic!(
34261 "buffer is too small (need {} bytes, but got {})",
34262 Self::ENCODED_LEN,
34263 __tmp.remaining(),
34264 )
34265 }
34266 __tmp.put_u64_le(self.time_usec);
34267 __tmp.put_f32_le(self.wind_x);
34268 __tmp.put_f32_le(self.wind_y);
34269 __tmp.put_f32_le(self.wind_z);
34270 __tmp.put_f32_le(self.var_horiz);
34271 __tmp.put_f32_le(self.var_vert);
34272 __tmp.put_f32_le(self.wind_alt);
34273 __tmp.put_f32_le(self.horiz_accuracy);
34274 __tmp.put_f32_le(self.vert_accuracy);
34275 if matches!(version, MavlinkVersion::V2) {
34276 let len = __tmp.len();
34277 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34278 } else {
34279 __tmp.len()
34280 }
34281 }
34282}
34283#[derive(Clone, PartialEq, Debug)]
34284#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34285#[cfg_attr(feature = "serde", serde(tag = "type"))]
34286#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34287#[cfg_attr(feature = "ts", derive(TS))]
34288#[cfg_attr(feature = "ts", ts(export))]
34289#[repr(u32)]
34290pub enum MavMessage {
34291 #[doc = "Set the vehicle attitude and body angular rates."]
34292 #[doc = ""]
34293 #[doc = "ID: 140"]
34294 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
34295 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
34296 #[doc = ""]
34297 #[doc = "ID: 375"]
34298 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
34299 #[doc = "The location and information of an ADSB vehicle."]
34300 #[doc = ""]
34301 #[doc = "ID: 246"]
34302 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
34303 #[doc = "The location and information of an AIS vessel."]
34304 #[doc = ""]
34305 #[doc = "ID: 301"]
34306 AIS_VESSEL(AIS_VESSEL_DATA),
34307 #[doc = "The current system altitude."]
34308 #[doc = ""]
34309 #[doc = "ID: 141"]
34310 ALTITUDE(ALTITUDE_DATA),
34311 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
34312 #[doc = ""]
34313 #[doc = "ID: 30"]
34314 ATTITUDE(ATTITUDE_DATA),
34315 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
34316 #[doc = ""]
34317 #[doc = "ID: 31"]
34318 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
34319 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
34320 #[doc = ""]
34321 #[doc = "ID: 61"]
34322 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
34323 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
34324 #[doc = ""]
34325 #[doc = "ID: 83"]
34326 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
34327 #[doc = "Motion capture attitude and position."]
34328 #[doc = ""]
34329 #[doc = "ID: 138"]
34330 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
34331 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
34332 #[doc = ""]
34333 #[doc = "ID: 7"]
34334 AUTH_KEY(AUTH_KEY_DATA),
34335 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
34336 #[doc = ""]
34337 #[doc = "ID: 286"]
34338 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
34339 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
34340 #[doc = ""]
34341 #[doc = "ID: 148"]
34342 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
34343 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
34344 #[doc = ""]
34345 #[doc = "ID: 435"]
34346 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
34347 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
34348 #[doc = ""]
34349 #[doc = "ID: 437"]
34350 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
34351 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
34352 #[doc = ""]
34353 #[doc = "ID: 372"]
34354 BATTERY_INFO(BATTERY_INFO_DATA),
34355 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
34356 #[doc = ""]
34357 #[doc = "ID: 147"]
34358 BATTERY_STATUS(BATTERY_STATUS_DATA),
34359 #[doc = "Report button state change."]
34360 #[doc = ""]
34361 #[doc = "ID: 257"]
34362 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
34363 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
34364 #[doc = ""]
34365 #[doc = "ID: 262"]
34366 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
34367 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
34368 #[doc = ""]
34369 #[doc = "ID: 271"]
34370 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
34371 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
34372 #[doc = ""]
34373 #[doc = "ID: 263"]
34374 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
34375 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
34376 #[doc = ""]
34377 #[doc = "ID: 259"]
34378 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
34379 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
34380 #[doc = ""]
34381 #[doc = "ID: 260"]
34382 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
34383 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
34384 #[doc = ""]
34385 #[doc = "ID: 277"]
34386 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
34387 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
34388 #[doc = ""]
34389 #[doc = "ID: 276"]
34390 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
34391 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
34392 #[doc = ""]
34393 #[doc = "ID: 275"]
34394 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
34395 #[doc = "Camera-IMU triggering and synchronisation message."]
34396 #[doc = ""]
34397 #[doc = "ID: 112"]
34398 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
34399 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
34400 #[doc = ""]
34401 #[doc = "ID: 387"]
34402 CANFD_FRAME(CANFD_FRAME_DATA),
34403 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
34404 #[doc = ""]
34405 #[doc = "ID: 388"]
34406 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
34407 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
34408 #[doc = ""]
34409 #[doc = "ID: 386"]
34410 CAN_FRAME(CAN_FRAME_DATA),
34411 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
34412 #[doc = ""]
34413 #[doc = "ID: 336"]
34414 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
34415 #[doc = "Report current used cellular network status."]
34416 #[doc = ""]
34417 #[doc = "ID: 334"]
34418 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
34419 #[doc = "Request to control this MAV."]
34420 #[doc = ""]
34421 #[doc = "ID: 5"]
34422 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
34423 #[doc = "Accept / deny control of this MAV."]
34424 #[doc = ""]
34425 #[doc = "ID: 6"]
34426 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
34427 #[doc = "Information about a potential collision."]
34428 #[doc = ""]
34429 #[doc = "ID: 247"]
34430 COLLISION(COLLISION_DATA),
34431 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
34432 #[doc = ""]
34433 #[doc = "ID: 77"]
34434 COMMAND_ACK(COMMAND_ACK_DATA),
34435 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
34436 #[doc = ""]
34437 #[doc = "ID: 80"]
34438 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
34439 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
34440 #[doc = ""]
34441 #[doc = "ID: 75"]
34442 COMMAND_INT(COMMAND_INT_DATA),
34443 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
34444 #[doc = ""]
34445 #[doc = "ID: 76"]
34446 COMMAND_LONG(COMMAND_LONG_DATA),
34447 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
34448 #[doc = ""]
34449 #[doc = "ID: 395"]
34450 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
34451 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
34452 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
34453 #[doc = ""]
34454 #[doc = "ID: 396"]
34455 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
34456 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
34457 #[doc = ""]
34458 #[doc = "ID: 397"]
34459 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
34460 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
34461 #[doc = ""]
34462 #[doc = "ID: 146"]
34463 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
34464 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
34465 #[doc = ""]
34466 #[doc = "ID: 411"]
34467 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
34468 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
34469 #[doc = ""]
34470 #[doc = "ID: 436"]
34471 CURRENT_MODE(CURRENT_MODE_DATA),
34472 #[doc = "Data stream status information."]
34473 #[doc = ""]
34474 #[doc = "ID: 67"]
34475 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
34476 DATA_STREAM(DATA_STREAM_DATA),
34477 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
34478 #[doc = ""]
34479 #[doc = "ID: 130"]
34480 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
34481 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
34482 #[doc = ""]
34483 #[doc = "ID: 254"]
34484 DEBUG(DEBUG_DATA),
34485 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
34486 #[doc = ""]
34487 #[doc = "ID: 350"]
34488 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
34489 #[doc = "To debug something using a named 3D vector."]
34490 #[doc = ""]
34491 #[doc = "ID: 250"]
34492 DEBUG_VECT(DEBUG_VECT_DATA),
34493 #[doc = "Distance sensor information for an onboard rangefinder."]
34494 #[doc = ""]
34495 #[doc = "ID: 132"]
34496 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
34497 #[doc = "EFI status output."]
34498 #[doc = ""]
34499 #[doc = "ID: 225"]
34500 EFI_STATUS(EFI_STATUS_DATA),
34501 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
34502 #[doc = ""]
34503 #[doc = "ID: 131"]
34504 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
34505 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
34506 #[doc = ""]
34507 #[doc = "ID: 290"]
34508 ESC_INFO(ESC_INFO_DATA),
34509 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
34510 #[doc = ""]
34511 #[doc = "ID: 291"]
34512 ESC_STATUS(ESC_STATUS_DATA),
34513 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
34514 #[doc = ""]
34515 #[doc = "ID: 230"]
34516 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
34517 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
34518 #[doc = ""]
34519 #[doc = "ID: 410"]
34520 EVENT(EVENT_DATA),
34521 #[doc = "Provides state for additional features."]
34522 #[doc = ""]
34523 #[doc = "ID: 245"]
34524 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
34525 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
34526 #[doc = ""]
34527 #[doc = "ID: 162"]
34528 FENCE_STATUS(FENCE_STATUS_DATA),
34529 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
34530 #[doc = ""]
34531 #[doc = "ID: 110"]
34532 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
34533 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
34534 #[doc = ""]
34535 #[doc = "ID: 264"]
34536 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
34537 #[doc = "Current motion information from a designated system."]
34538 #[doc = ""]
34539 #[doc = "ID: 144"]
34540 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
34541 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
34542 #[doc = ""]
34543 #[doc = "ID: 371"]
34544 FUEL_STATUS(FUEL_STATUS_DATA),
34545 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
34546 #[doc = ""]
34547 #[doc = "ID: 373"]
34548 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
34549 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
34550 #[doc = ""]
34551 #[doc = "ID: 285"]
34552 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
34553 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
34554 #[doc = ""]
34555 #[doc = "ID: 283"]
34556 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
34557 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
34558 #[doc = ""]
34559 #[doc = "ID: 284"]
34560 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
34561 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
34562 #[doc = ""]
34563 #[doc = "ID: 280"]
34564 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
34565 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
34566 #[doc = ""]
34567 #[doc = "ID: 282"]
34568 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
34569 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
34570 #[doc = ""]
34571 #[doc = "ID: 288"]
34572 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
34573 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
34574 #[doc = ""]
34575 #[doc = "ID: 287"]
34576 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
34577 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
34578 #[doc = ""]
34579 #[doc = "ID: 281"]
34580 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
34581 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
34582 #[doc = ""]
34583 #[doc = "ID: 33"]
34584 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
34585 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
34586 #[doc = ""]
34587 #[doc = "ID: 63"]
34588 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
34589 #[doc = "Global position/attitude estimate from a vision source."]
34590 #[doc = ""]
34591 #[doc = "ID: 101"]
34592 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
34593 #[doc = "Second GPS data."]
34594 #[doc = ""]
34595 #[doc = "ID: 124"]
34596 GPS2_RAW(GPS2_RAW_DATA),
34597 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
34598 #[doc = ""]
34599 #[doc = "ID: 128"]
34600 GPS2_RTK(GPS2_RTK_DATA),
34601 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
34602 #[doc = ""]
34603 #[doc = "ID: 49"]
34604 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
34605 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
34606 #[doc = ""]
34607 #[doc = "ID: 123"]
34608 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
34609 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
34610 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
34611 #[doc = ""]
34612 #[doc = "ID: 232"]
34613 GPS_INPUT(GPS_INPUT_DATA),
34614 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
34615 #[doc = ""]
34616 #[doc = "ID: 24"]
34617 GPS_RAW_INT(GPS_RAW_INT_DATA),
34618 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
34619 #[doc = ""]
34620 #[doc = "ID: 233"]
34621 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
34622 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
34623 #[doc = ""]
34624 #[doc = "ID: 127"]
34625 GPS_RTK(GPS_RTK_DATA),
34626 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
34627 #[doc = ""]
34628 #[doc = "ID: 25"]
34629 GPS_STATUS(GPS_STATUS_DATA),
34630 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
34631 #[doc = ""]
34632 #[doc = "ID: 0"]
34633 HEARTBEAT(HEARTBEAT_DATA),
34634 #[doc = "The IMU readings in SI units in NED body frame."]
34635 #[doc = ""]
34636 #[doc = "ID: 105"]
34637 HIGHRES_IMU(HIGHRES_IMU_DATA),
34638 #[doc = "Message appropriate for high latency connections like Iridium."]
34639 #[doc = ""]
34640 #[doc = "ID: 234"]
34641 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
34642 HIGH_LATENCY(HIGH_LATENCY_DATA),
34643 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
34644 #[doc = ""]
34645 #[doc = "ID: 235"]
34646 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
34647 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
34648 #[doc = ""]
34649 #[doc = "ID: 93"]
34650 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
34651 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
34652 #[doc = ""]
34653 #[doc = "ID: 91"]
34654 HIL_CONTROLS(HIL_CONTROLS_DATA),
34655 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
34656 #[doc = ""]
34657 #[doc = "ID: 113"]
34658 HIL_GPS(HIL_GPS_DATA),
34659 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
34660 #[doc = ""]
34661 #[doc = "ID: 114"]
34662 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
34663 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
34664 #[doc = ""]
34665 #[doc = "ID: 92"]
34666 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
34667 #[doc = "The IMU readings in SI units in NED body frame."]
34668 #[doc = ""]
34669 #[doc = "ID: 107"]
34670 HIL_SENSOR(HIL_SENSOR_DATA),
34671 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
34672 #[doc = ""]
34673 #[doc = "ID: 90"]
34674 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
34675 HIL_STATE(HIL_STATE_DATA),
34676 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
34677 #[doc = ""]
34678 #[doc = "ID: 115"]
34679 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
34680 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
34681 #[doc = ""]
34682 #[doc = "ID: 242"]
34683 HOME_POSITION(HOME_POSITION_DATA),
34684 #[doc = "Temperature and humidity from hygrometer."]
34685 #[doc = ""]
34686 #[doc = "ID: 12920"]
34687 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
34688 #[doc = "Illuminator status."]
34689 #[doc = ""]
34690 #[doc = "ID: 440"]
34691 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
34692 #[doc = "Status of the Iridium SBD link."]
34693 #[doc = ""]
34694 #[doc = "ID: 335"]
34695 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
34696 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
34697 #[doc = ""]
34698 #[doc = "ID: 149"]
34699 LANDING_TARGET(LANDING_TARGET_DATA),
34700 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
34701 #[doc = ""]
34702 #[doc = "ID: 8"]
34703 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
34704 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
34705 #[doc = ""]
34706 #[doc = "ID: 32"]
34707 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
34708 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
34709 #[doc = ""]
34710 #[doc = "ID: 64"]
34711 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
34712 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
34713 #[doc = ""]
34714 #[doc = "ID: 89"]
34715 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
34716 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
34717 #[doc = ""]
34718 #[doc = "ID: 268"]
34719 LOGGING_ACK(LOGGING_ACK_DATA),
34720 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
34721 #[doc = ""]
34722 #[doc = "ID: 266"]
34723 LOGGING_DATA(LOGGING_DATA_DATA),
34724 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
34725 #[doc = ""]
34726 #[doc = "ID: 267"]
34727 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
34728 #[doc = "Reply to LOG_REQUEST_DATA."]
34729 #[doc = ""]
34730 #[doc = "ID: 120"]
34731 LOG_DATA(LOG_DATA_DATA),
34732 #[doc = "Reply to LOG_REQUEST_LIST."]
34733 #[doc = ""]
34734 #[doc = "ID: 118"]
34735 LOG_ENTRY(LOG_ENTRY_DATA),
34736 #[doc = "Erase all logs."]
34737 #[doc = ""]
34738 #[doc = "ID: 121"]
34739 LOG_ERASE(LOG_ERASE_DATA),
34740 #[doc = "Request a chunk of a log."]
34741 #[doc = ""]
34742 #[doc = "ID: 119"]
34743 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
34744 #[doc = "Stop log transfer and resume normal logging."]
34745 #[doc = ""]
34746 #[doc = "ID: 122"]
34747 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
34748 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
34749 #[doc = ""]
34750 #[doc = "ID: 117"]
34751 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
34752 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
34753 #[doc = ""]
34754 #[doc = "ID: 192"]
34755 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
34756 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
34757 #[doc = ""]
34758 #[doc = "ID: 69"]
34759 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
34760 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
34761 #[doc = ""]
34762 #[doc = "ID: 81"]
34763 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
34764 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
34765 #[doc = ""]
34766 #[doc = "ID: 249"]
34767 MEMORY_VECT(MEMORY_VECT_DATA),
34768 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
34769 #[doc = ""]
34770 #[doc = "ID: 244"]
34771 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
34772 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
34773 #[doc = ""]
34774 #[doc = "ID: 47"]
34775 MISSION_ACK(MISSION_ACK_DATA),
34776 #[doc = "Delete all mission items at once."]
34777 #[doc = ""]
34778 #[doc = "ID: 45"]
34779 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
34780 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
34781 #[doc = ""]
34782 #[doc = "ID: 44"]
34783 MISSION_COUNT(MISSION_COUNT_DATA),
34784 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
34785 #[doc = ""]
34786 #[doc = "ID: 42"]
34787 MISSION_CURRENT(MISSION_CURRENT_DATA),
34788 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
34789 #[doc = ""]
34790 #[doc = "ID: 39"]
34791 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
34792 MISSION_ITEM(MISSION_ITEM_DATA),
34793 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
34794 #[doc = ""]
34795 #[doc = "ID: 73"]
34796 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
34797 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
34798 #[doc = ""]
34799 #[doc = "ID: 46"]
34800 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
34801 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
34802 #[doc = ""]
34803 #[doc = "ID: 40"]
34804 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
34805 MISSION_REQUEST(MISSION_REQUEST_DATA),
34806 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
34807 #[doc = ""]
34808 #[doc = "ID: 51"]
34809 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
34810 #[doc = "Request the overall list of mission items from the system/component."]
34811 #[doc = ""]
34812 #[doc = "ID: 43"]
34813 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
34814 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
34815 #[doc = ""]
34816 #[doc = "ID: 37"]
34817 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
34818 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
34819 #[doc = ""]
34820 #[doc = "ID: 41"]
34821 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
34822 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
34823 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
34824 #[doc = ""]
34825 #[doc = "ID: 38"]
34826 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
34827 #[doc = "Orientation of a mount."]
34828 #[doc = ""]
34829 #[doc = "ID: 265"]
34830 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
34831 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
34832 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
34833 #[doc = ""]
34834 #[doc = "ID: 251"]
34835 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
34836 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
34837 #[doc = ""]
34838 #[doc = "ID: 252"]
34839 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
34840 #[doc = "The state of the navigation and position controller."]
34841 #[doc = ""]
34842 #[doc = "ID: 62"]
34843 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
34844 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
34845 #[doc = ""]
34846 #[doc = "ID: 330"]
34847 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
34848 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
34849 #[doc = ""]
34850 #[doc = "ID: 331"]
34851 ODOMETRY(ODOMETRY_DATA),
34852 #[doc = "Hardware status sent by an onboard computer."]
34853 #[doc = ""]
34854 #[doc = "ID: 390"]
34855 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
34856 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
34857 #[doc = ""]
34858 #[doc = "ID: 12918"]
34859 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
34860 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
34861 #[doc = ""]
34862 #[doc = "ID: 12902"]
34863 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
34864 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
34865 #[doc = ""]
34866 #[doc = "ID: 12900"]
34867 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
34868 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
34869 #[doc = ""]
34870 #[doc = "ID: 12901"]
34871 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
34872 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
34873 #[doc = ""]
34874 #[doc = "ID: 12915"]
34875 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
34876 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
34877 #[doc = ""]
34878 #[doc = "ID: 12905"]
34879 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
34880 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
34881 #[doc = ""]
34882 #[doc = "ID: 12903"]
34883 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
34884 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
34885 #[doc = ""]
34886 #[doc = "ID: 12904"]
34887 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
34888 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
34889 #[doc = ""]
34890 #[doc = "ID: 12919"]
34891 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
34892 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
34893 #[doc = ""]
34894 #[doc = "ID: 100"]
34895 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
34896 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
34897 #[doc = ""]
34898 #[doc = "ID: 106"]
34899 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
34900 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
34901 #[doc = ""]
34902 #[doc = "ID: 360"]
34903 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
34904 #[doc = "Response from a PARAM_EXT_SET message."]
34905 #[doc = ""]
34906 #[doc = "ID: 324"]
34907 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
34908 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
34909 #[doc = ""]
34910 #[doc = "ID: 321"]
34911 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
34912 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
34913 #[doc = ""]
34914 #[doc = "ID: 320"]
34915 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
34916 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
34917 #[doc = ""]
34918 #[doc = "ID: 323"]
34919 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
34920 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
34921 #[doc = ""]
34922 #[doc = "ID: 322"]
34923 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
34924 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
34925 #[doc = ""]
34926 #[doc = "ID: 50"]
34927 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
34928 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
34929 #[doc = ""]
34930 #[doc = "ID: 21"]
34931 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
34932 #[doc = "Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] ->value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
34933 #[doc = ""]
34934 #[doc = "ID: 20"]
34935 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
34936 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
34937 #[doc = ""]
34938 #[doc = "ID: 23"]
34939 PARAM_SET(PARAM_SET_DATA),
34940 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
34941 #[doc = ""]
34942 #[doc = "ID: 22"]
34943 PARAM_VALUE(PARAM_VALUE_DATA),
34944 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
34945 #[doc = ""]
34946 #[doc = "ID: 4"]
34947 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
34948 PING(PING_DATA),
34949 #[doc = "Control vehicle tone generation (buzzer)."]
34950 #[doc = ""]
34951 #[doc = "ID: 258"]
34952 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
34953 PLAY_TUNE(PLAY_TUNE_DATA),
34954 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
34955 #[doc = ""]
34956 #[doc = "ID: 400"]
34957 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
34958 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
34959 #[doc = ""]
34960 #[doc = "ID: 87"]
34961 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
34962 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
34963 #[doc = ""]
34964 #[doc = "ID: 85"]
34965 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
34966 #[doc = "Power supply status."]
34967 #[doc = ""]
34968 #[doc = "ID: 125"]
34969 POWER_STATUS(POWER_STATUS_DATA),
34970 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
34971 #[doc = ""]
34972 #[doc = "ID: 300"]
34973 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
34974 #[doc = "Status generated by radio and injected into MAVLink stream."]
34975 #[doc = ""]
34976 #[doc = "ID: 109"]
34977 RADIO_STATUS(RADIO_STATUS_DATA),
34978 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
34979 #[doc = ""]
34980 #[doc = "ID: 27"]
34981 RAW_IMU(RAW_IMU_DATA),
34982 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
34983 #[doc = ""]
34984 #[doc = "ID: 28"]
34985 RAW_PRESSURE(RAW_PRESSURE_DATA),
34986 #[doc = "RPM sensor data message."]
34987 #[doc = ""]
34988 #[doc = "ID: 339"]
34989 RAW_RPM(RAW_RPM_DATA),
34990 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
34991 #[doc = ""]
34992 #[doc = "ID: 65"]
34993 RC_CHANNELS(RC_CHANNELS_DATA),
34994 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
34995 #[doc = ""]
34996 #[doc = "ID: 70"]
34997 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
34998 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
34999 #[doc = ""]
35000 #[doc = "ID: 35"]
35001 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
35002 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
35003 #[doc = ""]
35004 #[doc = "ID: 34"]
35005 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
35006 #[doc = "Request a data stream."]
35007 #[doc = ""]
35008 #[doc = "ID: 66"]
35009 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
35010 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
35011 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
35012 #[doc = ""]
35013 #[doc = "ID: 412"]
35014 REQUEST_EVENT(REQUEST_EVENT_DATA),
35015 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
35016 #[doc = ""]
35017 #[doc = "ID: 142"]
35018 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
35019 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
35020 #[doc = ""]
35021 #[doc = "ID: 413"]
35022 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
35023 #[doc = "Read out the safety zone the MAV currently assumes."]
35024 #[doc = ""]
35025 #[doc = "ID: 55"]
35026 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
35027 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
35028 #[doc = ""]
35029 #[doc = "ID: 54"]
35030 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
35031 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
35032 #[doc = ""]
35033 #[doc = "ID: 26"]
35034 SCALED_IMU(SCALED_IMU_DATA),
35035 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
35036 #[doc = ""]
35037 #[doc = "ID: 116"]
35038 SCALED_IMU2(SCALED_IMU2_DATA),
35039 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
35040 #[doc = ""]
35041 #[doc = "ID: 129"]
35042 SCALED_IMU3(SCALED_IMU3_DATA),
35043 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
35044 #[doc = ""]
35045 #[doc = "ID: 29"]
35046 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
35047 #[doc = "Barometer readings for 2nd barometer."]
35048 #[doc = ""]
35049 #[doc = "ID: 137"]
35050 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
35051 #[doc = "Barometer readings for 3rd barometer."]
35052 #[doc = ""]
35053 #[doc = "ID: 143"]
35054 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
35055 #[doc = "This message is emitted as response to SCRIPT_REQUEST_LIST by the MAV to get the number of mission scripts."]
35056 #[doc = ""]
35057 #[doc = "ID: 183"]
35058 SCRIPT_COUNT(SCRIPT_COUNT_DATA),
35059 #[doc = "This message informs about the currently active SCRIPT."]
35060 #[doc = ""]
35061 #[doc = "ID: 184"]
35062 SCRIPT_CURRENT(SCRIPT_CURRENT_DATA),
35063 #[doc = "Message encoding a mission script item. This message is emitted upon a request for the next script item."]
35064 #[doc = ""]
35065 #[doc = "ID: 180"]
35066 SCRIPT_ITEM(SCRIPT_ITEM_DATA),
35067 #[doc = "Request script item with the sequence number seq. The response of the system to this message should be a SCRIPT_ITEM message."]
35068 #[doc = ""]
35069 #[doc = "ID: 181"]
35070 SCRIPT_REQUEST(SCRIPT_REQUEST_DATA),
35071 #[doc = "Request the overall list of mission items from the system/component."]
35072 #[doc = ""]
35073 #[doc = "ID: 182"]
35074 SCRIPT_REQUEST_LIST(SCRIPT_REQUEST_LIST_DATA),
35075 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
35076 #[doc = ""]
35077 #[doc = "ID: 126"]
35078 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
35079 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
35080 #[doc = ""]
35081 #[doc = "ID: 36"]
35082 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
35083 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
35084 #[doc = ""]
35085 #[doc = "ID: 256"]
35086 SETUP_SIGNING(SETUP_SIGNING_DATA),
35087 #[doc = "Set the vehicle attitude and body angular rates."]
35088 #[doc = ""]
35089 #[doc = "ID: 139"]
35090 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
35091 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
35092 #[doc = ""]
35093 #[doc = "ID: 82"]
35094 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
35095 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
35096 #[doc = ""]
35097 #[doc = "ID: 48"]
35098 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
35099 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
35100 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
35101 #[doc = ""]
35102 #[doc = "ID: 243"]
35103 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
35104 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
35105 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
35106 #[doc = ""]
35107 #[doc = "ID: 11"]
35108 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
35109 SET_MODE(SET_MODE_DATA),
35110 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
35111 #[doc = ""]
35112 #[doc = "ID: 86"]
35113 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
35114 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
35115 #[doc = ""]
35116 #[doc = "ID: 84"]
35117 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
35118 #[doc = "Status of simulation environment, if used."]
35119 #[doc = ""]
35120 #[doc = "ID: 108"]
35121 SIM_STATE(SIM_STATE_DATA),
35122 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
35123 #[doc = ""]
35124 #[doc = "ID: 370"]
35125 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
35126 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
35127 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
35128 #[doc = ""]
35129 #[doc = "ID: 253"]
35130 STATUSTEXT(STATUSTEXT_DATA),
35131 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
35132 #[doc = ""]
35133 #[doc = "ID: 261"]
35134 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
35135 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
35136 #[doc = ""]
35137 #[doc = "ID: 401"]
35138 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
35139 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
35140 #[doc = ""]
35141 #[doc = "ID: 2"]
35142 SYSTEM_TIME(SYSTEM_TIME_DATA),
35143 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
35144 #[doc = ""]
35145 #[doc = "ID: 1"]
35146 SYS_STATUS(SYS_STATUS_DATA),
35147 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
35148 #[doc = ""]
35149 #[doc = "ID: 135"]
35150 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
35151 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
35152 #[doc = ""]
35153 #[doc = "ID: 134"]
35154 TERRAIN_DATA(TERRAIN_DATA_DATA),
35155 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
35156 #[doc = ""]
35157 #[doc = "ID: 136"]
35158 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
35159 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
35160 #[doc = ""]
35161 #[doc = "ID: 133"]
35162 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
35163 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
35164 #[doc = ""]
35165 #[doc = "ID: 111"]
35166 TIMESYNC(TIMESYNC_DATA),
35167 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
35168 #[doc = ""]
35169 #[doc = "ID: 380"]
35170 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
35171 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
35172 #[doc = ""]
35173 #[doc = "ID: 333"]
35174 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
35175 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
35176 #[doc = ""]
35177 #[doc = "ID: 332"]
35178 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
35179 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
35180 #[doc = ""]
35181 #[doc = "ID: 385"]
35182 TUNNEL(TUNNEL_DATA),
35183 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
35184 #[doc = ""]
35185 #[doc = "ID: 311"]
35186 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
35187 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
35188 #[doc = ""]
35189 #[doc = "ID: 310"]
35190 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
35191 #[doc = "The global position resulting from GPS and sensor fusion."]
35192 #[doc = ""]
35193 #[doc = "ID: 340"]
35194 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
35195 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
35196 #[doc = ""]
35197 #[doc = "ID: 248"]
35198 V2_EXTENSION(V2_EXTENSION_DATA),
35199 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
35200 #[doc = ""]
35201 #[doc = "ID: 74"]
35202 VFR_HUD(VFR_HUD_DATA),
35203 #[doc = "Vibration levels and accelerometer clipping."]
35204 #[doc = ""]
35205 #[doc = "ID: 241"]
35206 VIBRATION(VIBRATION_DATA),
35207 #[doc = "Global position estimate from a Vicon motion system source."]
35208 #[doc = ""]
35209 #[doc = "ID: 104"]
35210 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
35211 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
35212 #[doc = ""]
35213 #[doc = "ID: 269"]
35214 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
35215 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
35216 #[doc = ""]
35217 #[doc = "ID: 270"]
35218 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
35219 #[doc = "Local position/attitude estimate from a vision source."]
35220 #[doc = ""]
35221 #[doc = "ID: 102"]
35222 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
35223 #[doc = "Speed estimate from a vision source."]
35224 #[doc = ""]
35225 #[doc = "ID: 103"]
35226 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
35227 #[doc = "Cumulative distance traveled for each reported wheel."]
35228 #[doc = ""]
35229 #[doc = "ID: 9000"]
35230 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
35231 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
35232 #[doc = ""]
35233 #[doc = "ID: 299"]
35234 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
35235 #[doc = "Winch status."]
35236 #[doc = ""]
35237 #[doc = "ID: 9005"]
35238 WINCH_STATUS(WINCH_STATUS_DATA),
35239 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
35240 #[doc = ""]
35241 #[doc = "ID: 231"]
35242 WIND_COV(WIND_COV_DATA),
35243}
35244impl MavMessage {
35245 pub const fn all_ids() -> &'static [u32] {
35246 &[
35247 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
35248 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
35249 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
35250 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
35251 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
35252 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
35253 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
35254 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
35255 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
35256 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
35257 148u32, 149u32, 162u32, 180u32, 181u32, 182u32, 183u32, 184u32, 192u32, 225u32, 230u32,
35258 231u32, 232u32, 233u32, 234u32, 235u32, 241u32, 242u32, 243u32, 244u32, 245u32, 246u32,
35259 247u32, 248u32, 249u32, 250u32, 251u32, 252u32, 253u32, 254u32, 256u32, 257u32, 258u32,
35260 259u32, 260u32, 261u32, 262u32, 263u32, 264u32, 265u32, 266u32, 267u32, 268u32, 269u32,
35261 270u32, 271u32, 275u32, 276u32, 277u32, 280u32, 281u32, 282u32, 283u32, 284u32, 285u32,
35262 286u32, 287u32, 288u32, 290u32, 291u32, 299u32, 300u32, 301u32, 310u32, 311u32, 320u32,
35263 321u32, 322u32, 323u32, 324u32, 330u32, 331u32, 332u32, 333u32, 334u32, 335u32, 336u32,
35264 339u32, 340u32, 350u32, 360u32, 370u32, 371u32, 372u32, 373u32, 375u32, 380u32, 385u32,
35265 386u32, 387u32, 388u32, 390u32, 395u32, 396u32, 397u32, 400u32, 401u32, 410u32, 411u32,
35266 412u32, 413u32, 435u32, 436u32, 437u32, 440u32, 9000u32, 9005u32, 12900u32, 12901u32,
35267 12902u32, 12903u32, 12904u32, 12905u32, 12915u32, 12918u32, 12919u32, 12920u32,
35268 ]
35269 }
35270 pub const fn all_messages() -> &'static [(&'static str, u32)] {
35271 &[
35272 (HEARTBEAT_DATA::NAME, HEARTBEAT_DATA::ID),
35273 (SYS_STATUS_DATA::NAME, SYS_STATUS_DATA::ID),
35274 (SYSTEM_TIME_DATA::NAME, SYSTEM_TIME_DATA::ID),
35275 (PING_DATA::NAME, PING_DATA::ID),
35276 (
35277 CHANGE_OPERATOR_CONTROL_DATA::NAME,
35278 CHANGE_OPERATOR_CONTROL_DATA::ID,
35279 ),
35280 (
35281 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
35282 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
35283 ),
35284 (AUTH_KEY_DATA::NAME, AUTH_KEY_DATA::ID),
35285 (LINK_NODE_STATUS_DATA::NAME, LINK_NODE_STATUS_DATA::ID),
35286 (SET_MODE_DATA::NAME, SET_MODE_DATA::ID),
35287 (PARAM_REQUEST_READ_DATA::NAME, PARAM_REQUEST_READ_DATA::ID),
35288 (PARAM_REQUEST_LIST_DATA::NAME, PARAM_REQUEST_LIST_DATA::ID),
35289 (PARAM_VALUE_DATA::NAME, PARAM_VALUE_DATA::ID),
35290 (PARAM_SET_DATA::NAME, PARAM_SET_DATA::ID),
35291 (GPS_RAW_INT_DATA::NAME, GPS_RAW_INT_DATA::ID),
35292 (GPS_STATUS_DATA::NAME, GPS_STATUS_DATA::ID),
35293 (SCALED_IMU_DATA::NAME, SCALED_IMU_DATA::ID),
35294 (RAW_IMU_DATA::NAME, RAW_IMU_DATA::ID),
35295 (RAW_PRESSURE_DATA::NAME, RAW_PRESSURE_DATA::ID),
35296 (SCALED_PRESSURE_DATA::NAME, SCALED_PRESSURE_DATA::ID),
35297 (ATTITUDE_DATA::NAME, ATTITUDE_DATA::ID),
35298 (ATTITUDE_QUATERNION_DATA::NAME, ATTITUDE_QUATERNION_DATA::ID),
35299 (LOCAL_POSITION_NED_DATA::NAME, LOCAL_POSITION_NED_DATA::ID),
35300 (GLOBAL_POSITION_INT_DATA::NAME, GLOBAL_POSITION_INT_DATA::ID),
35301 (RC_CHANNELS_SCALED_DATA::NAME, RC_CHANNELS_SCALED_DATA::ID),
35302 (RC_CHANNELS_RAW_DATA::NAME, RC_CHANNELS_RAW_DATA::ID),
35303 (SERVO_OUTPUT_RAW_DATA::NAME, SERVO_OUTPUT_RAW_DATA::ID),
35304 (
35305 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
35306 MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
35307 ),
35308 (
35309 MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
35310 MISSION_WRITE_PARTIAL_LIST_DATA::ID,
35311 ),
35312 (MISSION_ITEM_DATA::NAME, MISSION_ITEM_DATA::ID),
35313 (MISSION_REQUEST_DATA::NAME, MISSION_REQUEST_DATA::ID),
35314 (MISSION_SET_CURRENT_DATA::NAME, MISSION_SET_CURRENT_DATA::ID),
35315 (MISSION_CURRENT_DATA::NAME, MISSION_CURRENT_DATA::ID),
35316 (
35317 MISSION_REQUEST_LIST_DATA::NAME,
35318 MISSION_REQUEST_LIST_DATA::ID,
35319 ),
35320 (MISSION_COUNT_DATA::NAME, MISSION_COUNT_DATA::ID),
35321 (MISSION_CLEAR_ALL_DATA::NAME, MISSION_CLEAR_ALL_DATA::ID),
35322 (
35323 MISSION_ITEM_REACHED_DATA::NAME,
35324 MISSION_ITEM_REACHED_DATA::ID,
35325 ),
35326 (MISSION_ACK_DATA::NAME, MISSION_ACK_DATA::ID),
35327 (
35328 SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
35329 SET_GPS_GLOBAL_ORIGIN_DATA::ID,
35330 ),
35331 (GPS_GLOBAL_ORIGIN_DATA::NAME, GPS_GLOBAL_ORIGIN_DATA::ID),
35332 (PARAM_MAP_RC_DATA::NAME, PARAM_MAP_RC_DATA::ID),
35333 (MISSION_REQUEST_INT_DATA::NAME, MISSION_REQUEST_INT_DATA::ID),
35334 (
35335 SAFETY_SET_ALLOWED_AREA_DATA::NAME,
35336 SAFETY_SET_ALLOWED_AREA_DATA::ID,
35337 ),
35338 (SAFETY_ALLOWED_AREA_DATA::NAME, SAFETY_ALLOWED_AREA_DATA::ID),
35339 (
35340 ATTITUDE_QUATERNION_COV_DATA::NAME,
35341 ATTITUDE_QUATERNION_COV_DATA::ID,
35342 ),
35343 (
35344 NAV_CONTROLLER_OUTPUT_DATA::NAME,
35345 NAV_CONTROLLER_OUTPUT_DATA::ID,
35346 ),
35347 (
35348 GLOBAL_POSITION_INT_COV_DATA::NAME,
35349 GLOBAL_POSITION_INT_COV_DATA::ID,
35350 ),
35351 (
35352 LOCAL_POSITION_NED_COV_DATA::NAME,
35353 LOCAL_POSITION_NED_COV_DATA::ID,
35354 ),
35355 (RC_CHANNELS_DATA::NAME, RC_CHANNELS_DATA::ID),
35356 (REQUEST_DATA_STREAM_DATA::NAME, REQUEST_DATA_STREAM_DATA::ID),
35357 (DATA_STREAM_DATA::NAME, DATA_STREAM_DATA::ID),
35358 (MANUAL_CONTROL_DATA::NAME, MANUAL_CONTROL_DATA::ID),
35359 (
35360 RC_CHANNELS_OVERRIDE_DATA::NAME,
35361 RC_CHANNELS_OVERRIDE_DATA::ID,
35362 ),
35363 (MISSION_ITEM_INT_DATA::NAME, MISSION_ITEM_INT_DATA::ID),
35364 (VFR_HUD_DATA::NAME, VFR_HUD_DATA::ID),
35365 (COMMAND_INT_DATA::NAME, COMMAND_INT_DATA::ID),
35366 (COMMAND_LONG_DATA::NAME, COMMAND_LONG_DATA::ID),
35367 (COMMAND_ACK_DATA::NAME, COMMAND_ACK_DATA::ID),
35368 (COMMAND_CANCEL_DATA::NAME, COMMAND_CANCEL_DATA::ID),
35369 (MANUAL_SETPOINT_DATA::NAME, MANUAL_SETPOINT_DATA::ID),
35370 (SET_ATTITUDE_TARGET_DATA::NAME, SET_ATTITUDE_TARGET_DATA::ID),
35371 (ATTITUDE_TARGET_DATA::NAME, ATTITUDE_TARGET_DATA::ID),
35372 (
35373 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
35374 SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
35375 ),
35376 (
35377 POSITION_TARGET_LOCAL_NED_DATA::NAME,
35378 POSITION_TARGET_LOCAL_NED_DATA::ID,
35379 ),
35380 (
35381 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
35382 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
35383 ),
35384 (
35385 POSITION_TARGET_GLOBAL_INT_DATA::NAME,
35386 POSITION_TARGET_GLOBAL_INT_DATA::ID,
35387 ),
35388 (
35389 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME,
35390 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID,
35391 ),
35392 (HIL_STATE_DATA::NAME, HIL_STATE_DATA::ID),
35393 (HIL_CONTROLS_DATA::NAME, HIL_CONTROLS_DATA::ID),
35394 (HIL_RC_INPUTS_RAW_DATA::NAME, HIL_RC_INPUTS_RAW_DATA::ID),
35395 (
35396 HIL_ACTUATOR_CONTROLS_DATA::NAME,
35397 HIL_ACTUATOR_CONTROLS_DATA::ID,
35398 ),
35399 (OPTICAL_FLOW_DATA::NAME, OPTICAL_FLOW_DATA::ID),
35400 (
35401 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
35402 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
35403 ),
35404 (
35405 VISION_POSITION_ESTIMATE_DATA::NAME,
35406 VISION_POSITION_ESTIMATE_DATA::ID,
35407 ),
35408 (
35409 VISION_SPEED_ESTIMATE_DATA::NAME,
35410 VISION_SPEED_ESTIMATE_DATA::ID,
35411 ),
35412 (
35413 VICON_POSITION_ESTIMATE_DATA::NAME,
35414 VICON_POSITION_ESTIMATE_DATA::ID,
35415 ),
35416 (HIGHRES_IMU_DATA::NAME, HIGHRES_IMU_DATA::ID),
35417 (OPTICAL_FLOW_RAD_DATA::NAME, OPTICAL_FLOW_RAD_DATA::ID),
35418 (HIL_SENSOR_DATA::NAME, HIL_SENSOR_DATA::ID),
35419 (SIM_STATE_DATA::NAME, SIM_STATE_DATA::ID),
35420 (RADIO_STATUS_DATA::NAME, RADIO_STATUS_DATA::ID),
35421 (
35422 FILE_TRANSFER_PROTOCOL_DATA::NAME,
35423 FILE_TRANSFER_PROTOCOL_DATA::ID,
35424 ),
35425 (TIMESYNC_DATA::NAME, TIMESYNC_DATA::ID),
35426 (CAMERA_TRIGGER_DATA::NAME, CAMERA_TRIGGER_DATA::ID),
35427 (HIL_GPS_DATA::NAME, HIL_GPS_DATA::ID),
35428 (HIL_OPTICAL_FLOW_DATA::NAME, HIL_OPTICAL_FLOW_DATA::ID),
35429 (
35430 HIL_STATE_QUATERNION_DATA::NAME,
35431 HIL_STATE_QUATERNION_DATA::ID,
35432 ),
35433 (SCALED_IMU2_DATA::NAME, SCALED_IMU2_DATA::ID),
35434 (LOG_REQUEST_LIST_DATA::NAME, LOG_REQUEST_LIST_DATA::ID),
35435 (LOG_ENTRY_DATA::NAME, LOG_ENTRY_DATA::ID),
35436 (LOG_REQUEST_DATA_DATA::NAME, LOG_REQUEST_DATA_DATA::ID),
35437 (LOG_DATA_DATA::NAME, LOG_DATA_DATA::ID),
35438 (LOG_ERASE_DATA::NAME, LOG_ERASE_DATA::ID),
35439 (LOG_REQUEST_END_DATA::NAME, LOG_REQUEST_END_DATA::ID),
35440 (GPS_INJECT_DATA_DATA::NAME, GPS_INJECT_DATA_DATA::ID),
35441 (GPS2_RAW_DATA::NAME, GPS2_RAW_DATA::ID),
35442 (POWER_STATUS_DATA::NAME, POWER_STATUS_DATA::ID),
35443 (SERIAL_CONTROL_DATA::NAME, SERIAL_CONTROL_DATA::ID),
35444 (GPS_RTK_DATA::NAME, GPS_RTK_DATA::ID),
35445 (GPS2_RTK_DATA::NAME, GPS2_RTK_DATA::ID),
35446 (SCALED_IMU3_DATA::NAME, SCALED_IMU3_DATA::ID),
35447 (
35448 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
35449 DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
35450 ),
35451 (ENCAPSULATED_DATA_DATA::NAME, ENCAPSULATED_DATA_DATA::ID),
35452 (DISTANCE_SENSOR_DATA::NAME, DISTANCE_SENSOR_DATA::ID),
35453 (TERRAIN_REQUEST_DATA::NAME, TERRAIN_REQUEST_DATA::ID),
35454 (TERRAIN_DATA_DATA::NAME, TERRAIN_DATA_DATA::ID),
35455 (TERRAIN_CHECK_DATA::NAME, TERRAIN_CHECK_DATA::ID),
35456 (TERRAIN_REPORT_DATA::NAME, TERRAIN_REPORT_DATA::ID),
35457 (SCALED_PRESSURE2_DATA::NAME, SCALED_PRESSURE2_DATA::ID),
35458 (ATT_POS_MOCAP_DATA::NAME, ATT_POS_MOCAP_DATA::ID),
35459 (
35460 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
35461 SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
35462 ),
35463 (
35464 ACTUATOR_CONTROL_TARGET_DATA::NAME,
35465 ACTUATOR_CONTROL_TARGET_DATA::ID,
35466 ),
35467 (ALTITUDE_DATA::NAME, ALTITUDE_DATA::ID),
35468 (RESOURCE_REQUEST_DATA::NAME, RESOURCE_REQUEST_DATA::ID),
35469 (SCALED_PRESSURE3_DATA::NAME, SCALED_PRESSURE3_DATA::ID),
35470 (FOLLOW_TARGET_DATA::NAME, FOLLOW_TARGET_DATA::ID),
35471 (
35472 CONTROL_SYSTEM_STATE_DATA::NAME,
35473 CONTROL_SYSTEM_STATE_DATA::ID,
35474 ),
35475 (BATTERY_STATUS_DATA::NAME, BATTERY_STATUS_DATA::ID),
35476 (AUTOPILOT_VERSION_DATA::NAME, AUTOPILOT_VERSION_DATA::ID),
35477 (LANDING_TARGET_DATA::NAME, LANDING_TARGET_DATA::ID),
35478 (FENCE_STATUS_DATA::NAME, FENCE_STATUS_DATA::ID),
35479 (SCRIPT_ITEM_DATA::NAME, SCRIPT_ITEM_DATA::ID),
35480 (SCRIPT_REQUEST_DATA::NAME, SCRIPT_REQUEST_DATA::ID),
35481 (SCRIPT_REQUEST_LIST_DATA::NAME, SCRIPT_REQUEST_LIST_DATA::ID),
35482 (SCRIPT_COUNT_DATA::NAME, SCRIPT_COUNT_DATA::ID),
35483 (SCRIPT_CURRENT_DATA::NAME, SCRIPT_CURRENT_DATA::ID),
35484 (MAG_CAL_REPORT_DATA::NAME, MAG_CAL_REPORT_DATA::ID),
35485 (EFI_STATUS_DATA::NAME, EFI_STATUS_DATA::ID),
35486 (ESTIMATOR_STATUS_DATA::NAME, ESTIMATOR_STATUS_DATA::ID),
35487 (WIND_COV_DATA::NAME, WIND_COV_DATA::ID),
35488 (GPS_INPUT_DATA::NAME, GPS_INPUT_DATA::ID),
35489 (GPS_RTCM_DATA_DATA::NAME, GPS_RTCM_DATA_DATA::ID),
35490 (HIGH_LATENCY_DATA::NAME, HIGH_LATENCY_DATA::ID),
35491 (HIGH_LATENCY2_DATA::NAME, HIGH_LATENCY2_DATA::ID),
35492 (VIBRATION_DATA::NAME, VIBRATION_DATA::ID),
35493 (HOME_POSITION_DATA::NAME, HOME_POSITION_DATA::ID),
35494 (SET_HOME_POSITION_DATA::NAME, SET_HOME_POSITION_DATA::ID),
35495 (MESSAGE_INTERVAL_DATA::NAME, MESSAGE_INTERVAL_DATA::ID),
35496 (EXTENDED_SYS_STATE_DATA::NAME, EXTENDED_SYS_STATE_DATA::ID),
35497 (ADSB_VEHICLE_DATA::NAME, ADSB_VEHICLE_DATA::ID),
35498 (COLLISION_DATA::NAME, COLLISION_DATA::ID),
35499 (V2_EXTENSION_DATA::NAME, V2_EXTENSION_DATA::ID),
35500 (MEMORY_VECT_DATA::NAME, MEMORY_VECT_DATA::ID),
35501 (DEBUG_VECT_DATA::NAME, DEBUG_VECT_DATA::ID),
35502 (NAMED_VALUE_FLOAT_DATA::NAME, NAMED_VALUE_FLOAT_DATA::ID),
35503 (NAMED_VALUE_INT_DATA::NAME, NAMED_VALUE_INT_DATA::ID),
35504 (STATUSTEXT_DATA::NAME, STATUSTEXT_DATA::ID),
35505 (DEBUG_DATA::NAME, DEBUG_DATA::ID),
35506 (SETUP_SIGNING_DATA::NAME, SETUP_SIGNING_DATA::ID),
35507 (BUTTON_CHANGE_DATA::NAME, BUTTON_CHANGE_DATA::ID),
35508 (PLAY_TUNE_DATA::NAME, PLAY_TUNE_DATA::ID),
35509 (CAMERA_INFORMATION_DATA::NAME, CAMERA_INFORMATION_DATA::ID),
35510 (CAMERA_SETTINGS_DATA::NAME, CAMERA_SETTINGS_DATA::ID),
35511 (STORAGE_INFORMATION_DATA::NAME, STORAGE_INFORMATION_DATA::ID),
35512 (
35513 CAMERA_CAPTURE_STATUS_DATA::NAME,
35514 CAMERA_CAPTURE_STATUS_DATA::ID,
35515 ),
35516 (
35517 CAMERA_IMAGE_CAPTURED_DATA::NAME,
35518 CAMERA_IMAGE_CAPTURED_DATA::ID,
35519 ),
35520 (FLIGHT_INFORMATION_DATA::NAME, FLIGHT_INFORMATION_DATA::ID),
35521 (MOUNT_ORIENTATION_DATA::NAME, MOUNT_ORIENTATION_DATA::ID),
35522 (LOGGING_DATA_DATA::NAME, LOGGING_DATA_DATA::ID),
35523 (LOGGING_DATA_ACKED_DATA::NAME, LOGGING_DATA_ACKED_DATA::ID),
35524 (LOGGING_ACK_DATA::NAME, LOGGING_ACK_DATA::ID),
35525 (
35526 VIDEO_STREAM_INFORMATION_DATA::NAME,
35527 VIDEO_STREAM_INFORMATION_DATA::ID,
35528 ),
35529 (VIDEO_STREAM_STATUS_DATA::NAME, VIDEO_STREAM_STATUS_DATA::ID),
35530 (CAMERA_FOV_STATUS_DATA::NAME, CAMERA_FOV_STATUS_DATA::ID),
35531 (
35532 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
35533 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
35534 ),
35535 (
35536 CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
35537 CAMERA_TRACKING_GEO_STATUS_DATA::ID,
35538 ),
35539 (
35540 CAMERA_THERMAL_RANGE_DATA::NAME,
35541 CAMERA_THERMAL_RANGE_DATA::ID,
35542 ),
35543 (
35544 GIMBAL_MANAGER_INFORMATION_DATA::NAME,
35545 GIMBAL_MANAGER_INFORMATION_DATA::ID,
35546 ),
35547 (
35548 GIMBAL_MANAGER_STATUS_DATA::NAME,
35549 GIMBAL_MANAGER_STATUS_DATA::ID,
35550 ),
35551 (
35552 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
35553 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
35554 ),
35555 (
35556 GIMBAL_DEVICE_INFORMATION_DATA::NAME,
35557 GIMBAL_DEVICE_INFORMATION_DATA::ID,
35558 ),
35559 (
35560 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
35561 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
35562 ),
35563 (
35564 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
35565 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
35566 ),
35567 (
35568 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME,
35569 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID,
35570 ),
35571 (
35572 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
35573 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
35574 ),
35575 (
35576 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME,
35577 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID,
35578 ),
35579 (ESC_INFO_DATA::NAME, ESC_INFO_DATA::ID),
35580 (ESC_STATUS_DATA::NAME, ESC_STATUS_DATA::ID),
35581 (WIFI_CONFIG_AP_DATA::NAME, WIFI_CONFIG_AP_DATA::ID),
35582 (PROTOCOL_VERSION_DATA::NAME, PROTOCOL_VERSION_DATA::ID),
35583 (AIS_VESSEL_DATA::NAME, AIS_VESSEL_DATA::ID),
35584 (UAVCAN_NODE_STATUS_DATA::NAME, UAVCAN_NODE_STATUS_DATA::ID),
35585 (UAVCAN_NODE_INFO_DATA::NAME, UAVCAN_NODE_INFO_DATA::ID),
35586 (
35587 PARAM_EXT_REQUEST_READ_DATA::NAME,
35588 PARAM_EXT_REQUEST_READ_DATA::ID,
35589 ),
35590 (
35591 PARAM_EXT_REQUEST_LIST_DATA::NAME,
35592 PARAM_EXT_REQUEST_LIST_DATA::ID,
35593 ),
35594 (PARAM_EXT_VALUE_DATA::NAME, PARAM_EXT_VALUE_DATA::ID),
35595 (PARAM_EXT_SET_DATA::NAME, PARAM_EXT_SET_DATA::ID),
35596 (PARAM_EXT_ACK_DATA::NAME, PARAM_EXT_ACK_DATA::ID),
35597 (OBSTACLE_DISTANCE_DATA::NAME, OBSTACLE_DISTANCE_DATA::ID),
35598 (ODOMETRY_DATA::NAME, ODOMETRY_DATA::ID),
35599 (
35600 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME,
35601 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID,
35602 ),
35603 (
35604 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME,
35605 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
35606 ),
35607 (CELLULAR_STATUS_DATA::NAME, CELLULAR_STATUS_DATA::ID),
35608 (ISBD_LINK_STATUS_DATA::NAME, ISBD_LINK_STATUS_DATA::ID),
35609 (CELLULAR_CONFIG_DATA::NAME, CELLULAR_CONFIG_DATA::ID),
35610 (RAW_RPM_DATA::NAME, RAW_RPM_DATA::ID),
35611 (UTM_GLOBAL_POSITION_DATA::NAME, UTM_GLOBAL_POSITION_DATA::ID),
35612 (DEBUG_FLOAT_ARRAY_DATA::NAME, DEBUG_FLOAT_ARRAY_DATA::ID),
35613 (
35614 ORBIT_EXECUTION_STATUS_DATA::NAME,
35615 ORBIT_EXECUTION_STATUS_DATA::ID,
35616 ),
35617 (SMART_BATTERY_INFO_DATA::NAME, SMART_BATTERY_INFO_DATA::ID),
35618 (FUEL_STATUS_DATA::NAME, FUEL_STATUS_DATA::ID),
35619 (BATTERY_INFO_DATA::NAME, BATTERY_INFO_DATA::ID),
35620 (GENERATOR_STATUS_DATA::NAME, GENERATOR_STATUS_DATA::ID),
35621 (
35622 ACTUATOR_OUTPUT_STATUS_DATA::NAME,
35623 ACTUATOR_OUTPUT_STATUS_DATA::ID,
35624 ),
35625 (
35626 TIME_ESTIMATE_TO_TARGET_DATA::NAME,
35627 TIME_ESTIMATE_TO_TARGET_DATA::ID,
35628 ),
35629 (TUNNEL_DATA::NAME, TUNNEL_DATA::ID),
35630 (CAN_FRAME_DATA::NAME, CAN_FRAME_DATA::ID),
35631 (CANFD_FRAME_DATA::NAME, CANFD_FRAME_DATA::ID),
35632 (CAN_FILTER_MODIFY_DATA::NAME, CAN_FILTER_MODIFY_DATA::ID),
35633 (
35634 ONBOARD_COMPUTER_STATUS_DATA::NAME,
35635 ONBOARD_COMPUTER_STATUS_DATA::ID,
35636 ),
35637 (
35638 COMPONENT_INFORMATION_DATA::NAME,
35639 COMPONENT_INFORMATION_DATA::ID,
35640 ),
35641 (
35642 COMPONENT_INFORMATION_BASIC_DATA::NAME,
35643 COMPONENT_INFORMATION_BASIC_DATA::ID,
35644 ),
35645 (COMPONENT_METADATA_DATA::NAME, COMPONENT_METADATA_DATA::ID),
35646 (PLAY_TUNE_V2_DATA::NAME, PLAY_TUNE_V2_DATA::ID),
35647 (SUPPORTED_TUNES_DATA::NAME, SUPPORTED_TUNES_DATA::ID),
35648 (EVENT_DATA::NAME, EVENT_DATA::ID),
35649 (
35650 CURRENT_EVENT_SEQUENCE_DATA::NAME,
35651 CURRENT_EVENT_SEQUENCE_DATA::ID,
35652 ),
35653 (REQUEST_EVENT_DATA::NAME, REQUEST_EVENT_DATA::ID),
35654 (
35655 RESPONSE_EVENT_ERROR_DATA::NAME,
35656 RESPONSE_EVENT_ERROR_DATA::ID,
35657 ),
35658 (AVAILABLE_MODES_DATA::NAME, AVAILABLE_MODES_DATA::ID),
35659 (CURRENT_MODE_DATA::NAME, CURRENT_MODE_DATA::ID),
35660 (
35661 AVAILABLE_MODES_MONITOR_DATA::NAME,
35662 AVAILABLE_MODES_MONITOR_DATA::ID,
35663 ),
35664 (ILLUMINATOR_STATUS_DATA::NAME, ILLUMINATOR_STATUS_DATA::ID),
35665 (WHEEL_DISTANCE_DATA::NAME, WHEEL_DISTANCE_DATA::ID),
35666 (WINCH_STATUS_DATA::NAME, WINCH_STATUS_DATA::ID),
35667 (
35668 OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
35669 OPEN_DRONE_ID_BASIC_ID_DATA::ID,
35670 ),
35671 (
35672 OPEN_DRONE_ID_LOCATION_DATA::NAME,
35673 OPEN_DRONE_ID_LOCATION_DATA::ID,
35674 ),
35675 (
35676 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
35677 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
35678 ),
35679 (
35680 OPEN_DRONE_ID_SELF_ID_DATA::NAME,
35681 OPEN_DRONE_ID_SELF_ID_DATA::ID,
35682 ),
35683 (
35684 OPEN_DRONE_ID_SYSTEM_DATA::NAME,
35685 OPEN_DRONE_ID_SYSTEM_DATA::ID,
35686 ),
35687 (
35688 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
35689 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
35690 ),
35691 (
35692 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
35693 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
35694 ),
35695 (
35696 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
35697 OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
35698 ),
35699 (
35700 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
35701 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
35702 ),
35703 (HYGROMETER_SENSOR_DATA::NAME, HYGROMETER_SENSOR_DATA::ID),
35704 ]
35705 }
35706}
35707impl Message for MavMessage {
35708 fn parse(
35709 version: MavlinkVersion,
35710 id: u32,
35711 payload: &[u8],
35712 ) -> Result<Self, ::mavlink_core::error::ParserError> {
35713 match id {
35714 ACTUATOR_CONTROL_TARGET_DATA::ID => {
35715 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
35716 .map(Self::ACTUATOR_CONTROL_TARGET)
35717 }
35718 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
35719 .map(Self::ACTUATOR_OUTPUT_STATUS),
35720 ADSB_VEHICLE_DATA::ID => {
35721 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
35722 }
35723 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
35724 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
35725 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
35726 ATTITUDE_QUATERNION_DATA::ID => {
35727 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
35728 }
35729 ATTITUDE_QUATERNION_COV_DATA::ID => {
35730 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
35731 .map(Self::ATTITUDE_QUATERNION_COV)
35732 }
35733 ATTITUDE_TARGET_DATA::ID => {
35734 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
35735 }
35736 ATT_POS_MOCAP_DATA::ID => {
35737 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
35738 }
35739 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
35740 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35741 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
35742 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
35743 }
35744 AUTOPILOT_VERSION_DATA::ID => {
35745 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
35746 }
35747 AVAILABLE_MODES_DATA::ID => {
35748 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
35749 }
35750 AVAILABLE_MODES_MONITOR_DATA::ID => {
35751 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
35752 .map(Self::AVAILABLE_MODES_MONITOR)
35753 }
35754 BATTERY_INFO_DATA::ID => {
35755 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
35756 }
35757 BATTERY_STATUS_DATA::ID => {
35758 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
35759 }
35760 BUTTON_CHANGE_DATA::ID => {
35761 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
35762 }
35763 CAMERA_CAPTURE_STATUS_DATA::ID => {
35764 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
35765 }
35766 CAMERA_FOV_STATUS_DATA::ID => {
35767 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
35768 }
35769 CAMERA_IMAGE_CAPTURED_DATA::ID => {
35770 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
35771 }
35772 CAMERA_INFORMATION_DATA::ID => {
35773 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
35774 }
35775 CAMERA_SETTINGS_DATA::ID => {
35776 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
35777 }
35778 CAMERA_THERMAL_RANGE_DATA::ID => {
35779 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
35780 }
35781 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
35782 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
35783 .map(Self::CAMERA_TRACKING_GEO_STATUS)
35784 }
35785 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
35786 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
35787 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
35788 }
35789 CAMERA_TRIGGER_DATA::ID => {
35790 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
35791 }
35792 CANFD_FRAME_DATA::ID => {
35793 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
35794 }
35795 CAN_FILTER_MODIFY_DATA::ID => {
35796 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
35797 }
35798 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
35799 CELLULAR_CONFIG_DATA::ID => {
35800 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
35801 }
35802 CELLULAR_STATUS_DATA::ID => {
35803 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
35804 }
35805 CHANGE_OPERATOR_CONTROL_DATA::ID => {
35806 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
35807 .map(Self::CHANGE_OPERATOR_CONTROL)
35808 }
35809 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
35810 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
35811 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
35812 }
35813 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
35814 COMMAND_ACK_DATA::ID => {
35815 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
35816 }
35817 COMMAND_CANCEL_DATA::ID => {
35818 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
35819 }
35820 COMMAND_INT_DATA::ID => {
35821 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
35822 }
35823 COMMAND_LONG_DATA::ID => {
35824 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
35825 }
35826 COMPONENT_INFORMATION_DATA::ID => {
35827 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
35828 }
35829 COMPONENT_INFORMATION_BASIC_DATA::ID => {
35830 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
35831 .map(Self::COMPONENT_INFORMATION_BASIC)
35832 }
35833 COMPONENT_METADATA_DATA::ID => {
35834 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
35835 }
35836 CONTROL_SYSTEM_STATE_DATA::ID => {
35837 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
35838 }
35839 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
35840 .map(Self::CURRENT_EVENT_SEQUENCE),
35841 CURRENT_MODE_DATA::ID => {
35842 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
35843 }
35844 DATA_STREAM_DATA::ID => {
35845 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
35846 }
35847 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
35848 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
35849 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
35850 }
35851 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
35852 DEBUG_FLOAT_ARRAY_DATA::ID => {
35853 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
35854 }
35855 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
35856 DISTANCE_SENSOR_DATA::ID => {
35857 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
35858 }
35859 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
35860 ENCAPSULATED_DATA_DATA::ID => {
35861 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
35862 }
35863 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
35864 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
35865 ESTIMATOR_STATUS_DATA::ID => {
35866 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
35867 }
35868 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
35869 EXTENDED_SYS_STATE_DATA::ID => {
35870 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
35871 }
35872 FENCE_STATUS_DATA::ID => {
35873 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
35874 }
35875 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
35876 .map(Self::FILE_TRANSFER_PROTOCOL),
35877 FLIGHT_INFORMATION_DATA::ID => {
35878 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
35879 }
35880 FOLLOW_TARGET_DATA::ID => {
35881 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
35882 }
35883 FUEL_STATUS_DATA::ID => {
35884 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
35885 }
35886 GENERATOR_STATUS_DATA::ID => {
35887 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
35888 }
35889 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
35890 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
35891 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
35892 }
35893 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
35894 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
35895 .map(Self::GIMBAL_DEVICE_INFORMATION)
35896 }
35897 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
35898 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
35899 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
35900 }
35901 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
35902 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
35903 .map(Self::GIMBAL_MANAGER_INFORMATION)
35904 }
35905 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
35906 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
35907 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
35908 }
35909 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35910 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
35911 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
35912 }
35913 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
35914 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
35915 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
35916 }
35917 GIMBAL_MANAGER_STATUS_DATA::ID => {
35918 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
35919 }
35920 GLOBAL_POSITION_INT_DATA::ID => {
35921 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
35922 }
35923 GLOBAL_POSITION_INT_COV_DATA::ID => {
35924 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
35925 .map(Self::GLOBAL_POSITION_INT_COV)
35926 }
35927 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35928 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
35929 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
35930 }
35931 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
35932 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
35933 GPS_GLOBAL_ORIGIN_DATA::ID => {
35934 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
35935 }
35936 GPS_INJECT_DATA_DATA::ID => {
35937 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
35938 }
35939 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
35940 GPS_RAW_INT_DATA::ID => {
35941 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
35942 }
35943 GPS_RTCM_DATA_DATA::ID => {
35944 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
35945 }
35946 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
35947 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
35948 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
35949 HIGHRES_IMU_DATA::ID => {
35950 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
35951 }
35952 HIGH_LATENCY_DATA::ID => {
35953 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
35954 }
35955 HIGH_LATENCY2_DATA::ID => {
35956 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
35957 }
35958 HIL_ACTUATOR_CONTROLS_DATA::ID => {
35959 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
35960 }
35961 HIL_CONTROLS_DATA::ID => {
35962 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
35963 }
35964 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
35965 HIL_OPTICAL_FLOW_DATA::ID => {
35966 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
35967 }
35968 HIL_RC_INPUTS_RAW_DATA::ID => {
35969 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
35970 }
35971 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
35972 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
35973 HIL_STATE_QUATERNION_DATA::ID => {
35974 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
35975 }
35976 HOME_POSITION_DATA::ID => {
35977 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
35978 }
35979 HYGROMETER_SENSOR_DATA::ID => {
35980 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
35981 }
35982 ILLUMINATOR_STATUS_DATA::ID => {
35983 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
35984 }
35985 ISBD_LINK_STATUS_DATA::ID => {
35986 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
35987 }
35988 LANDING_TARGET_DATA::ID => {
35989 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
35990 }
35991 LINK_NODE_STATUS_DATA::ID => {
35992 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
35993 }
35994 LOCAL_POSITION_NED_DATA::ID => {
35995 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
35996 }
35997 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
35998 .map(Self::LOCAL_POSITION_NED_COV),
35999 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36000 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
36001 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
36002 }
36003 LOGGING_ACK_DATA::ID => {
36004 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
36005 }
36006 LOGGING_DATA_DATA::ID => {
36007 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
36008 }
36009 LOGGING_DATA_ACKED_DATA::ID => {
36010 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
36011 }
36012 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
36013 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
36014 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
36015 LOG_REQUEST_DATA_DATA::ID => {
36016 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
36017 }
36018 LOG_REQUEST_END_DATA::ID => {
36019 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
36020 }
36021 LOG_REQUEST_LIST_DATA::ID => {
36022 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
36023 }
36024 MAG_CAL_REPORT_DATA::ID => {
36025 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
36026 }
36027 MANUAL_CONTROL_DATA::ID => {
36028 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
36029 }
36030 MANUAL_SETPOINT_DATA::ID => {
36031 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
36032 }
36033 MEMORY_VECT_DATA::ID => {
36034 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
36035 }
36036 MESSAGE_INTERVAL_DATA::ID => {
36037 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
36038 }
36039 MISSION_ACK_DATA::ID => {
36040 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
36041 }
36042 MISSION_CLEAR_ALL_DATA::ID => {
36043 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
36044 }
36045 MISSION_COUNT_DATA::ID => {
36046 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
36047 }
36048 MISSION_CURRENT_DATA::ID => {
36049 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
36050 }
36051 MISSION_ITEM_DATA::ID => {
36052 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
36053 }
36054 MISSION_ITEM_INT_DATA::ID => {
36055 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
36056 }
36057 MISSION_ITEM_REACHED_DATA::ID => {
36058 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
36059 }
36060 MISSION_REQUEST_DATA::ID => {
36061 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
36062 }
36063 MISSION_REQUEST_INT_DATA::ID => {
36064 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
36065 }
36066 MISSION_REQUEST_LIST_DATA::ID => {
36067 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
36068 }
36069 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
36070 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
36071 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
36072 }
36073 MISSION_SET_CURRENT_DATA::ID => {
36074 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
36075 }
36076 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
36077 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
36078 .map(Self::MISSION_WRITE_PARTIAL_LIST)
36079 }
36080 MOUNT_ORIENTATION_DATA::ID => {
36081 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
36082 }
36083 NAMED_VALUE_FLOAT_DATA::ID => {
36084 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
36085 }
36086 NAMED_VALUE_INT_DATA::ID => {
36087 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
36088 }
36089 NAV_CONTROLLER_OUTPUT_DATA::ID => {
36090 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
36091 }
36092 OBSTACLE_DISTANCE_DATA::ID => {
36093 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
36094 }
36095 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
36096 ONBOARD_COMPUTER_STATUS_DATA::ID => {
36097 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
36098 .map(Self::ONBOARD_COMPUTER_STATUS)
36099 }
36100 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
36101 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
36102 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
36103 }
36104 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
36105 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
36106 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
36107 }
36108 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
36109 .map(Self::OPEN_DRONE_ID_BASIC_ID),
36110 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
36111 .map(Self::OPEN_DRONE_ID_LOCATION),
36112 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
36113 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
36114 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
36115 }
36116 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
36117 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
36118 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
36119 }
36120 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
36121 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
36122 }
36123 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
36124 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
36125 }
36126 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
36127 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
36128 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
36129 }
36130 OPTICAL_FLOW_DATA::ID => {
36131 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
36132 }
36133 OPTICAL_FLOW_RAD_DATA::ID => {
36134 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
36135 }
36136 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
36137 .map(Self::ORBIT_EXECUTION_STATUS),
36138 PARAM_EXT_ACK_DATA::ID => {
36139 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
36140 }
36141 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
36142 .map(Self::PARAM_EXT_REQUEST_LIST),
36143 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
36144 .map(Self::PARAM_EXT_REQUEST_READ),
36145 PARAM_EXT_SET_DATA::ID => {
36146 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
36147 }
36148 PARAM_EXT_VALUE_DATA::ID => {
36149 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
36150 }
36151 PARAM_MAP_RC_DATA::ID => {
36152 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
36153 }
36154 PARAM_REQUEST_LIST_DATA::ID => {
36155 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
36156 }
36157 PARAM_REQUEST_READ_DATA::ID => {
36158 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
36159 }
36160 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
36161 PARAM_VALUE_DATA::ID => {
36162 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
36163 }
36164 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
36165 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
36166 PLAY_TUNE_V2_DATA::ID => {
36167 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
36168 }
36169 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
36170 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
36171 .map(Self::POSITION_TARGET_GLOBAL_INT)
36172 }
36173 POSITION_TARGET_LOCAL_NED_DATA::ID => {
36174 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
36175 .map(Self::POSITION_TARGET_LOCAL_NED)
36176 }
36177 POWER_STATUS_DATA::ID => {
36178 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
36179 }
36180 PROTOCOL_VERSION_DATA::ID => {
36181 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
36182 }
36183 RADIO_STATUS_DATA::ID => {
36184 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
36185 }
36186 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
36187 RAW_PRESSURE_DATA::ID => {
36188 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
36189 }
36190 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
36191 RC_CHANNELS_DATA::ID => {
36192 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
36193 }
36194 RC_CHANNELS_OVERRIDE_DATA::ID => {
36195 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
36196 }
36197 RC_CHANNELS_RAW_DATA::ID => {
36198 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
36199 }
36200 RC_CHANNELS_SCALED_DATA::ID => {
36201 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
36202 }
36203 REQUEST_DATA_STREAM_DATA::ID => {
36204 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
36205 }
36206 REQUEST_EVENT_DATA::ID => {
36207 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
36208 }
36209 RESOURCE_REQUEST_DATA::ID => {
36210 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
36211 }
36212 RESPONSE_EVENT_ERROR_DATA::ID => {
36213 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
36214 }
36215 SAFETY_ALLOWED_AREA_DATA::ID => {
36216 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
36217 }
36218 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
36219 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
36220 .map(Self::SAFETY_SET_ALLOWED_AREA)
36221 }
36222 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
36223 SCALED_IMU2_DATA::ID => {
36224 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
36225 }
36226 SCALED_IMU3_DATA::ID => {
36227 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
36228 }
36229 SCALED_PRESSURE_DATA::ID => {
36230 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
36231 }
36232 SCALED_PRESSURE2_DATA::ID => {
36233 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
36234 }
36235 SCALED_PRESSURE3_DATA::ID => {
36236 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
36237 }
36238 SCRIPT_COUNT_DATA::ID => {
36239 SCRIPT_COUNT_DATA::deser(version, payload).map(Self::SCRIPT_COUNT)
36240 }
36241 SCRIPT_CURRENT_DATA::ID => {
36242 SCRIPT_CURRENT_DATA::deser(version, payload).map(Self::SCRIPT_CURRENT)
36243 }
36244 SCRIPT_ITEM_DATA::ID => {
36245 SCRIPT_ITEM_DATA::deser(version, payload).map(Self::SCRIPT_ITEM)
36246 }
36247 SCRIPT_REQUEST_DATA::ID => {
36248 SCRIPT_REQUEST_DATA::deser(version, payload).map(Self::SCRIPT_REQUEST)
36249 }
36250 SCRIPT_REQUEST_LIST_DATA::ID => {
36251 SCRIPT_REQUEST_LIST_DATA::deser(version, payload).map(Self::SCRIPT_REQUEST_LIST)
36252 }
36253 SERIAL_CONTROL_DATA::ID => {
36254 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
36255 }
36256 SERVO_OUTPUT_RAW_DATA::ID => {
36257 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
36258 }
36259 SETUP_SIGNING_DATA::ID => {
36260 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
36261 }
36262 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
36263 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
36264 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
36265 }
36266 SET_ATTITUDE_TARGET_DATA::ID => {
36267 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
36268 }
36269 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
36270 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
36271 }
36272 SET_HOME_POSITION_DATA::ID => {
36273 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
36274 }
36275 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
36276 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
36277 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
36278 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
36279 }
36280 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
36281 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
36282 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
36283 }
36284 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
36285 SMART_BATTERY_INFO_DATA::ID => {
36286 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
36287 }
36288 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
36289 STORAGE_INFORMATION_DATA::ID => {
36290 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
36291 }
36292 SUPPORTED_TUNES_DATA::ID => {
36293 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
36294 }
36295 SYSTEM_TIME_DATA::ID => {
36296 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
36297 }
36298 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
36299 TERRAIN_CHECK_DATA::ID => {
36300 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
36301 }
36302 TERRAIN_DATA_DATA::ID => {
36303 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
36304 }
36305 TERRAIN_REPORT_DATA::ID => {
36306 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
36307 }
36308 TERRAIN_REQUEST_DATA::ID => {
36309 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
36310 }
36311 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
36312 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
36313 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
36314 .map(Self::TIME_ESTIMATE_TO_TARGET)
36315 }
36316 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36317 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
36318 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
36319 }
36320 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36321 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
36322 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
36323 }
36324 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
36325 UAVCAN_NODE_INFO_DATA::ID => {
36326 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
36327 }
36328 UAVCAN_NODE_STATUS_DATA::ID => {
36329 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
36330 }
36331 UTM_GLOBAL_POSITION_DATA::ID => {
36332 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
36333 }
36334 V2_EXTENSION_DATA::ID => {
36335 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
36336 }
36337 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
36338 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
36339 VICON_POSITION_ESTIMATE_DATA::ID => {
36340 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
36341 .map(Self::VICON_POSITION_ESTIMATE)
36342 }
36343 VIDEO_STREAM_INFORMATION_DATA::ID => {
36344 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
36345 .map(Self::VIDEO_STREAM_INFORMATION)
36346 }
36347 VIDEO_STREAM_STATUS_DATA::ID => {
36348 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
36349 }
36350 VISION_POSITION_ESTIMATE_DATA::ID => {
36351 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
36352 .map(Self::VISION_POSITION_ESTIMATE)
36353 }
36354 VISION_SPEED_ESTIMATE_DATA::ID => {
36355 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
36356 }
36357 WHEEL_DISTANCE_DATA::ID => {
36358 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
36359 }
36360 WIFI_CONFIG_AP_DATA::ID => {
36361 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
36362 }
36363 WINCH_STATUS_DATA::ID => {
36364 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
36365 }
36366 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
36367 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
36368 }
36369 }
36370 fn message_name(&self) -> &'static str {
36371 match self {
36372 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
36373 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
36374 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
36375 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
36376 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
36377 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
36378 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
36379 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
36380 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
36381 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
36382 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
36383 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
36384 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
36385 }
36386 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
36387 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
36388 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
36389 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
36390 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
36391 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
36392 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
36393 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
36394 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
36395 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
36396 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
36397 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
36398 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
36399 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
36400 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
36401 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
36402 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
36403 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
36404 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
36405 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
36406 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
36407 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
36408 Self::COLLISION(..) => COLLISION_DATA::NAME,
36409 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
36410 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
36411 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
36412 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
36413 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
36414 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
36415 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
36416 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
36417 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
36418 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
36419 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
36420 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
36421 Self::DEBUG(..) => DEBUG_DATA::NAME,
36422 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
36423 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
36424 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
36425 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
36426 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
36427 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
36428 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
36429 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
36430 Self::EVENT(..) => EVENT_DATA::NAME,
36431 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
36432 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
36433 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
36434 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
36435 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
36436 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
36437 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
36438 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
36439 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
36440 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
36441 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
36442 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
36443 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
36444 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
36445 }
36446 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
36447 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
36448 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
36449 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
36450 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
36451 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
36452 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
36453 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
36454 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
36455 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
36456 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
36457 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
36458 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
36459 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
36460 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
36461 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
36462 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
36463 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
36464 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
36465 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
36466 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
36467 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
36468 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
36469 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
36470 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
36471 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
36472 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
36473 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
36474 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
36475 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
36476 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
36477 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
36478 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
36479 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
36480 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
36481 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
36482 }
36483 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
36484 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
36485 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
36486 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
36487 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
36488 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
36489 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
36490 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
36491 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
36492 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
36493 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
36494 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
36495 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
36496 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
36497 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
36498 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
36499 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
36500 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
36501 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
36502 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
36503 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
36504 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
36505 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
36506 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
36507 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
36508 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
36509 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
36510 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
36511 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
36512 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
36513 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
36514 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
36515 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
36516 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
36517 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
36518 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
36519 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
36520 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
36521 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
36522 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
36523 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
36524 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
36525 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
36526 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
36527 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
36528 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
36529 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
36530 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
36531 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
36532 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
36533 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
36534 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
36535 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
36536 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
36537 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
36538 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
36539 Self::PING(..) => PING_DATA::NAME,
36540 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
36541 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
36542 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
36543 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
36544 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
36545 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
36546 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
36547 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
36548 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
36549 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
36550 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
36551 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
36552 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
36553 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
36554 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
36555 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
36556 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
36557 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
36558 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
36559 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
36560 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
36561 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
36562 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
36563 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
36564 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
36565 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
36566 Self::SCRIPT_COUNT(..) => SCRIPT_COUNT_DATA::NAME,
36567 Self::SCRIPT_CURRENT(..) => SCRIPT_CURRENT_DATA::NAME,
36568 Self::SCRIPT_ITEM(..) => SCRIPT_ITEM_DATA::NAME,
36569 Self::SCRIPT_REQUEST(..) => SCRIPT_REQUEST_DATA::NAME,
36570 Self::SCRIPT_REQUEST_LIST(..) => SCRIPT_REQUEST_LIST_DATA::NAME,
36571 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
36572 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
36573 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
36574 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
36575 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
36576 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
36577 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
36578 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
36579 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
36580 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
36581 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
36582 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
36583 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
36584 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
36585 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
36586 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
36587 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
36588 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
36589 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
36590 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
36591 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
36592 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
36593 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
36594 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
36595 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
36596 }
36597 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
36598 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
36599 }
36600 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
36601 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
36602 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
36603 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
36604 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
36605 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
36606 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
36607 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
36608 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
36609 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
36610 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
36611 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
36612 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
36613 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
36614 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
36615 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
36616 }
36617 }
36618 fn message_id(&self) -> u32 {
36619 match self {
36620 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
36621 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
36622 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
36623 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
36624 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
36625 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
36626 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
36627 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
36628 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
36629 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
36630 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
36631 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
36632 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
36633 }
36634 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
36635 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
36636 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
36637 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
36638 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
36639 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
36640 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
36641 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
36642 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
36643 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
36644 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
36645 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
36646 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
36647 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
36648 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
36649 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
36650 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
36651 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
36652 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
36653 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
36654 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
36655 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
36656 Self::COLLISION(..) => COLLISION_DATA::ID,
36657 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
36658 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
36659 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
36660 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
36661 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
36662 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
36663 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
36664 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
36665 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
36666 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
36667 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
36668 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
36669 Self::DEBUG(..) => DEBUG_DATA::ID,
36670 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
36671 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
36672 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
36673 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
36674 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
36675 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
36676 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
36677 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
36678 Self::EVENT(..) => EVENT_DATA::ID,
36679 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
36680 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
36681 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
36682 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
36683 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
36684 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
36685 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
36686 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
36687 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
36688 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
36689 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
36690 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
36691 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
36692 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
36693 }
36694 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
36695 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
36696 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
36697 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
36698 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
36699 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
36700 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
36701 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
36702 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
36703 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
36704 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
36705 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
36706 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
36707 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
36708 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
36709 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
36710 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
36711 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
36712 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
36713 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
36714 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
36715 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
36716 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
36717 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
36718 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
36719 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
36720 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
36721 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
36722 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
36723 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
36724 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
36725 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
36726 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
36727 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
36728 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
36729 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
36730 }
36731 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
36732 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
36733 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
36734 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
36735 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
36736 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
36737 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
36738 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
36739 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
36740 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
36741 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
36742 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
36743 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
36744 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
36745 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
36746 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
36747 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
36748 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
36749 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
36750 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
36751 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
36752 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
36753 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
36754 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
36755 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
36756 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
36757 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
36758 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
36759 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
36760 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
36761 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
36762 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
36763 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
36764 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
36765 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
36766 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
36767 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
36768 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
36769 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
36770 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
36771 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
36772 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
36773 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
36774 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
36775 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
36776 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
36777 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
36778 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
36779 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
36780 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
36781 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
36782 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
36783 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
36784 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
36785 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
36786 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
36787 Self::PING(..) => PING_DATA::ID,
36788 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
36789 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
36790 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
36791 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
36792 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
36793 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
36794 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
36795 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
36796 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
36797 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
36798 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
36799 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
36800 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
36801 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
36802 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
36803 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
36804 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
36805 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
36806 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
36807 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
36808 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
36809 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
36810 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
36811 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
36812 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
36813 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
36814 Self::SCRIPT_COUNT(..) => SCRIPT_COUNT_DATA::ID,
36815 Self::SCRIPT_CURRENT(..) => SCRIPT_CURRENT_DATA::ID,
36816 Self::SCRIPT_ITEM(..) => SCRIPT_ITEM_DATA::ID,
36817 Self::SCRIPT_REQUEST(..) => SCRIPT_REQUEST_DATA::ID,
36818 Self::SCRIPT_REQUEST_LIST(..) => SCRIPT_REQUEST_LIST_DATA::ID,
36819 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
36820 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
36821 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
36822 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
36823 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
36824 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
36825 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
36826 Self::SET_MODE(..) => SET_MODE_DATA::ID,
36827 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
36828 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
36829 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
36830 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
36831 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
36832 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
36833 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
36834 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
36835 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
36836 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
36837 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
36838 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
36839 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
36840 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
36841 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
36842 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
36843 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
36844 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
36845 }
36846 Self::TUNNEL(..) => TUNNEL_DATA::ID,
36847 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
36848 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
36849 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
36850 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
36851 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
36852 Self::VIBRATION(..) => VIBRATION_DATA::ID,
36853 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
36854 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
36855 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
36856 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
36857 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
36858 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
36859 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
36860 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
36861 Self::WIND_COV(..) => WIND_COV_DATA::ID,
36862 }
36863 }
36864 fn message_id_from_name(name: &str) -> Option<u32> {
36865 match name {
36866 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
36867 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
36868 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
36869 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
36870 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
36871 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
36872 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
36873 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
36874 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
36875 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
36876 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
36877 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
36878 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
36879 }
36880 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
36881 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
36882 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
36883 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
36884 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
36885 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
36886 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
36887 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
36888 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
36889 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
36890 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
36891 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
36892 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
36893 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
36894 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
36895 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
36896 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
36897 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
36898 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
36899 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
36900 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
36901 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
36902 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
36903 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
36904 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
36905 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
36906 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
36907 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
36908 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
36909 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
36910 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
36911 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
36912 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
36913 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
36914 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
36915 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
36916 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
36917 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
36918 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
36919 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
36920 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
36921 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
36922 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
36923 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
36924 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
36925 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
36926 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
36927 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
36928 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
36929 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
36930 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
36931 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
36932 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
36933 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
36934 }
36935 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
36936 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
36937 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
36938 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
36939 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
36940 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
36941 }
36942 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
36943 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
36944 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
36945 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
36946 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
36947 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
36948 }
36949 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
36950 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
36951 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
36952 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
36953 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
36954 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
36955 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
36956 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
36957 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
36958 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
36959 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
36960 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
36961 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
36962 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
36963 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
36964 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
36965 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
36966 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
36967 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
36968 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
36969 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
36970 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
36971 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
36972 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
36973 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
36974 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
36975 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
36976 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
36977 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
36978 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
36979 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
36980 }
36981 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
36982 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
36983 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
36984 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
36985 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
36986 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
36987 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
36988 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
36989 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
36990 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
36991 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
36992 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
36993 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
36994 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
36995 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
36996 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
36997 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
36998 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
36999 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
37000 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
37001 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
37002 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
37003 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
37004 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
37005 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
37006 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
37007 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
37008 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
37009 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
37010 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
37011 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
37012 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
37013 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
37014 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
37015 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
37016 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
37017 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
37018 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
37019 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
37020 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
37021 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
37022 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
37023 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
37024 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
37025 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
37026 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
37027 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
37028 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
37029 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
37030 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
37031 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
37032 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
37033 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
37034 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
37035 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
37036 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
37037 PING_DATA::NAME => Some(PING_DATA::ID),
37038 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
37039 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
37040 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
37041 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
37042 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
37043 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
37044 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
37045 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
37046 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
37047 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
37048 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
37049 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
37050 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
37051 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
37052 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
37053 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
37054 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
37055 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
37056 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
37057 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
37058 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
37059 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
37060 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
37061 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
37062 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
37063 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
37064 SCRIPT_COUNT_DATA::NAME => Some(SCRIPT_COUNT_DATA::ID),
37065 SCRIPT_CURRENT_DATA::NAME => Some(SCRIPT_CURRENT_DATA::ID),
37066 SCRIPT_ITEM_DATA::NAME => Some(SCRIPT_ITEM_DATA::ID),
37067 SCRIPT_REQUEST_DATA::NAME => Some(SCRIPT_REQUEST_DATA::ID),
37068 SCRIPT_REQUEST_LIST_DATA::NAME => Some(SCRIPT_REQUEST_LIST_DATA::ID),
37069 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
37070 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
37071 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
37072 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
37073 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
37074 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
37075 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
37076 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
37077 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
37078 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
37079 }
37080 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
37081 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
37082 }
37083 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
37084 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
37085 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
37086 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
37087 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
37088 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
37089 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
37090 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
37091 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
37092 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
37093 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
37094 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
37095 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
37096 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
37097 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
37098 }
37099 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
37100 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
37101 }
37102 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
37103 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
37104 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
37105 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
37106 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
37107 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
37108 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
37109 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
37110 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
37111 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
37112 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
37113 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
37114 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
37115 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
37116 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
37117 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
37118 _ => None,
37119 }
37120 }
37121 fn default_message_from_id(id: u32) -> Option<Self> {
37122 match id {
37123 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
37124 ACTUATOR_CONTROL_TARGET_DATA::default(),
37125 )),
37126 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
37127 ACTUATOR_OUTPUT_STATUS_DATA::default(),
37128 )),
37129 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
37130 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
37131 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
37132 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
37133 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
37134 ATTITUDE_QUATERNION_DATA::default(),
37135 )),
37136 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
37137 ATTITUDE_QUATERNION_COV_DATA::default(),
37138 )),
37139 ATTITUDE_TARGET_DATA::ID => {
37140 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
37141 }
37142 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
37143 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
37144 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
37145 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
37146 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
37147 ))
37148 }
37149 AUTOPILOT_VERSION_DATA::ID => {
37150 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
37151 }
37152 AVAILABLE_MODES_DATA::ID => {
37153 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
37154 }
37155 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
37156 AVAILABLE_MODES_MONITOR_DATA::default(),
37157 )),
37158 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
37159 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
37160 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
37161 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
37162 CAMERA_CAPTURE_STATUS_DATA::default(),
37163 )),
37164 CAMERA_FOV_STATUS_DATA::ID => {
37165 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
37166 }
37167 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
37168 CAMERA_IMAGE_CAPTURED_DATA::default(),
37169 )),
37170 CAMERA_INFORMATION_DATA::ID => {
37171 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
37172 }
37173 CAMERA_SETTINGS_DATA::ID => {
37174 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
37175 }
37176 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
37177 CAMERA_THERMAL_RANGE_DATA::default(),
37178 )),
37179 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
37180 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
37181 )),
37182 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
37183 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
37184 )),
37185 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
37186 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
37187 CAN_FILTER_MODIFY_DATA::ID => {
37188 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
37189 }
37190 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
37191 CELLULAR_CONFIG_DATA::ID => {
37192 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
37193 }
37194 CELLULAR_STATUS_DATA::ID => {
37195 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
37196 }
37197 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
37198 CHANGE_OPERATOR_CONTROL_DATA::default(),
37199 )),
37200 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
37201 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
37202 )),
37203 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
37204 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
37205 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
37206 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
37207 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
37208 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
37209 COMPONENT_INFORMATION_DATA::default(),
37210 )),
37211 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
37212 COMPONENT_INFORMATION_BASIC_DATA::default(),
37213 )),
37214 COMPONENT_METADATA_DATA::ID => {
37215 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
37216 }
37217 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
37218 CONTROL_SYSTEM_STATE_DATA::default(),
37219 )),
37220 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
37221 CURRENT_EVENT_SEQUENCE_DATA::default(),
37222 )),
37223 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
37224 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
37225 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
37226 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
37227 )),
37228 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
37229 DEBUG_FLOAT_ARRAY_DATA::ID => {
37230 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
37231 }
37232 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
37233 DISTANCE_SENSOR_DATA::ID => {
37234 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
37235 }
37236 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
37237 ENCAPSULATED_DATA_DATA::ID => {
37238 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
37239 }
37240 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
37241 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
37242 ESTIMATOR_STATUS_DATA::ID => {
37243 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
37244 }
37245 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
37246 EXTENDED_SYS_STATE_DATA::ID => {
37247 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
37248 }
37249 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
37250 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
37251 FILE_TRANSFER_PROTOCOL_DATA::default(),
37252 )),
37253 FLIGHT_INFORMATION_DATA::ID => {
37254 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
37255 }
37256 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
37257 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
37258 GENERATOR_STATUS_DATA::ID => {
37259 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
37260 }
37261 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
37262 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
37263 )),
37264 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
37265 GIMBAL_DEVICE_INFORMATION_DATA::default(),
37266 )),
37267 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
37268 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
37269 )),
37270 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
37271 GIMBAL_MANAGER_INFORMATION_DATA::default(),
37272 )),
37273 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
37274 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
37275 )),
37276 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
37277 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
37278 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
37279 ))
37280 }
37281 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
37282 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
37283 )),
37284 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
37285 GIMBAL_MANAGER_STATUS_DATA::default(),
37286 )),
37287 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
37288 GLOBAL_POSITION_INT_DATA::default(),
37289 )),
37290 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
37291 GLOBAL_POSITION_INT_COV_DATA::default(),
37292 )),
37293 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
37294 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
37295 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
37296 ))
37297 }
37298 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
37299 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
37300 GPS_GLOBAL_ORIGIN_DATA::ID => {
37301 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
37302 }
37303 GPS_INJECT_DATA_DATA::ID => {
37304 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
37305 }
37306 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
37307 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
37308 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
37309 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
37310 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
37311 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
37312 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
37313 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
37314 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
37315 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
37316 HIL_ACTUATOR_CONTROLS_DATA::default(),
37317 )),
37318 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
37319 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
37320 HIL_OPTICAL_FLOW_DATA::ID => {
37321 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
37322 }
37323 HIL_RC_INPUTS_RAW_DATA::ID => {
37324 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
37325 }
37326 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
37327 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
37328 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
37329 HIL_STATE_QUATERNION_DATA::default(),
37330 )),
37331 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
37332 HYGROMETER_SENSOR_DATA::ID => {
37333 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
37334 }
37335 ILLUMINATOR_STATUS_DATA::ID => {
37336 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
37337 }
37338 ISBD_LINK_STATUS_DATA::ID => {
37339 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
37340 }
37341 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
37342 LINK_NODE_STATUS_DATA::ID => {
37343 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
37344 }
37345 LOCAL_POSITION_NED_DATA::ID => {
37346 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
37347 }
37348 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
37349 LOCAL_POSITION_NED_COV_DATA::default(),
37350 )),
37351 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
37352 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
37353 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
37354 ))
37355 }
37356 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
37357 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
37358 LOGGING_DATA_ACKED_DATA::ID => {
37359 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
37360 }
37361 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
37362 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
37363 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
37364 LOG_REQUEST_DATA_DATA::ID => {
37365 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
37366 }
37367 LOG_REQUEST_END_DATA::ID => {
37368 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
37369 }
37370 LOG_REQUEST_LIST_DATA::ID => {
37371 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
37372 }
37373 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
37374 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
37375 MANUAL_SETPOINT_DATA::ID => {
37376 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
37377 }
37378 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
37379 MESSAGE_INTERVAL_DATA::ID => {
37380 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
37381 }
37382 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
37383 MISSION_CLEAR_ALL_DATA::ID => {
37384 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
37385 }
37386 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
37387 MISSION_CURRENT_DATA::ID => {
37388 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
37389 }
37390 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
37391 MISSION_ITEM_INT_DATA::ID => {
37392 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
37393 }
37394 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
37395 MISSION_ITEM_REACHED_DATA::default(),
37396 )),
37397 MISSION_REQUEST_DATA::ID => {
37398 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
37399 }
37400 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
37401 MISSION_REQUEST_INT_DATA::default(),
37402 )),
37403 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
37404 MISSION_REQUEST_LIST_DATA::default(),
37405 )),
37406 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
37407 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
37408 )),
37409 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
37410 MISSION_SET_CURRENT_DATA::default(),
37411 )),
37412 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
37413 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
37414 )),
37415 MOUNT_ORIENTATION_DATA::ID => {
37416 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
37417 }
37418 NAMED_VALUE_FLOAT_DATA::ID => {
37419 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
37420 }
37421 NAMED_VALUE_INT_DATA::ID => {
37422 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
37423 }
37424 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
37425 NAV_CONTROLLER_OUTPUT_DATA::default(),
37426 )),
37427 OBSTACLE_DISTANCE_DATA::ID => {
37428 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
37429 }
37430 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
37431 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
37432 ONBOARD_COMPUTER_STATUS_DATA::default(),
37433 )),
37434 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
37435 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
37436 )),
37437 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
37438 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
37439 )),
37440 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
37441 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
37442 )),
37443 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
37444 OPEN_DRONE_ID_LOCATION_DATA::default(),
37445 )),
37446 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
37447 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
37448 )),
37449 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
37450 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
37451 )),
37452 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
37453 OPEN_DRONE_ID_SELF_ID_DATA::default(),
37454 )),
37455 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
37456 OPEN_DRONE_ID_SYSTEM_DATA::default(),
37457 )),
37458 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
37459 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
37460 )),
37461 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
37462 OPTICAL_FLOW_RAD_DATA::ID => {
37463 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
37464 }
37465 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
37466 ORBIT_EXECUTION_STATUS_DATA::default(),
37467 )),
37468 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
37469 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
37470 PARAM_EXT_REQUEST_LIST_DATA::default(),
37471 )),
37472 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
37473 PARAM_EXT_REQUEST_READ_DATA::default(),
37474 )),
37475 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
37476 PARAM_EXT_VALUE_DATA::ID => {
37477 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
37478 }
37479 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
37480 PARAM_REQUEST_LIST_DATA::ID => {
37481 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
37482 }
37483 PARAM_REQUEST_READ_DATA::ID => {
37484 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
37485 }
37486 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
37487 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
37488 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
37489 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
37490 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
37491 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
37492 POSITION_TARGET_GLOBAL_INT_DATA::default(),
37493 )),
37494 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
37495 POSITION_TARGET_LOCAL_NED_DATA::default(),
37496 )),
37497 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
37498 PROTOCOL_VERSION_DATA::ID => {
37499 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
37500 }
37501 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
37502 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
37503 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
37504 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
37505 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
37506 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
37507 RC_CHANNELS_OVERRIDE_DATA::default(),
37508 )),
37509 RC_CHANNELS_RAW_DATA::ID => {
37510 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
37511 }
37512 RC_CHANNELS_SCALED_DATA::ID => {
37513 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
37514 }
37515 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
37516 REQUEST_DATA_STREAM_DATA::default(),
37517 )),
37518 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
37519 RESOURCE_REQUEST_DATA::ID => {
37520 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
37521 }
37522 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
37523 RESPONSE_EVENT_ERROR_DATA::default(),
37524 )),
37525 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
37526 SAFETY_ALLOWED_AREA_DATA::default(),
37527 )),
37528 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
37529 SAFETY_SET_ALLOWED_AREA_DATA::default(),
37530 )),
37531 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
37532 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
37533 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
37534 SCALED_PRESSURE_DATA::ID => {
37535 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
37536 }
37537 SCALED_PRESSURE2_DATA::ID => {
37538 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
37539 }
37540 SCALED_PRESSURE3_DATA::ID => {
37541 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
37542 }
37543 SCRIPT_COUNT_DATA::ID => Some(Self::SCRIPT_COUNT(SCRIPT_COUNT_DATA::default())),
37544 SCRIPT_CURRENT_DATA::ID => Some(Self::SCRIPT_CURRENT(SCRIPT_CURRENT_DATA::default())),
37545 SCRIPT_ITEM_DATA::ID => Some(Self::SCRIPT_ITEM(SCRIPT_ITEM_DATA::default())),
37546 SCRIPT_REQUEST_DATA::ID => Some(Self::SCRIPT_REQUEST(SCRIPT_REQUEST_DATA::default())),
37547 SCRIPT_REQUEST_LIST_DATA::ID => Some(Self::SCRIPT_REQUEST_LIST(
37548 SCRIPT_REQUEST_LIST_DATA::default(),
37549 )),
37550 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
37551 SERVO_OUTPUT_RAW_DATA::ID => {
37552 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
37553 }
37554 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
37555 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
37556 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
37557 )),
37558 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
37559 SET_ATTITUDE_TARGET_DATA::default(),
37560 )),
37561 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
37562 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
37563 )),
37564 SET_HOME_POSITION_DATA::ID => {
37565 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
37566 }
37567 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
37568 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
37569 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
37570 )),
37571 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
37572 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
37573 )),
37574 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
37575 SMART_BATTERY_INFO_DATA::ID => {
37576 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
37577 }
37578 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
37579 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
37580 STORAGE_INFORMATION_DATA::default(),
37581 )),
37582 SUPPORTED_TUNES_DATA::ID => {
37583 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
37584 }
37585 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
37586 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
37587 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
37588 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
37589 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
37590 TERRAIN_REQUEST_DATA::ID => {
37591 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
37592 }
37593 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
37594 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
37595 TIME_ESTIMATE_TO_TARGET_DATA::default(),
37596 )),
37597 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
37598 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
37599 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
37600 ))
37601 }
37602 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
37603 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
37604 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
37605 ))
37606 }
37607 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
37608 UAVCAN_NODE_INFO_DATA::ID => {
37609 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
37610 }
37611 UAVCAN_NODE_STATUS_DATA::ID => {
37612 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
37613 }
37614 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
37615 UTM_GLOBAL_POSITION_DATA::default(),
37616 )),
37617 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
37618 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
37619 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
37620 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
37621 VICON_POSITION_ESTIMATE_DATA::default(),
37622 )),
37623 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
37624 VIDEO_STREAM_INFORMATION_DATA::default(),
37625 )),
37626 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
37627 VIDEO_STREAM_STATUS_DATA::default(),
37628 )),
37629 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
37630 VISION_POSITION_ESTIMATE_DATA::default(),
37631 )),
37632 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
37633 VISION_SPEED_ESTIMATE_DATA::default(),
37634 )),
37635 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
37636 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
37637 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
37638 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
37639 _ => None,
37640 }
37641 }
37642 #[cfg(feature = "arbitrary")]
37643 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
37644 match id {
37645 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
37646 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
37647 )),
37648 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
37649 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
37650 )),
37651 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
37652 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
37653 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
37654 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
37655 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
37656 ATTITUDE_QUATERNION_DATA::random(rng),
37657 )),
37658 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
37659 ATTITUDE_QUATERNION_COV_DATA::random(rng),
37660 )),
37661 ATTITUDE_TARGET_DATA::ID => {
37662 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
37663 }
37664 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
37665 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
37666 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
37667 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
37668 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
37669 ))
37670 }
37671 AUTOPILOT_VERSION_DATA::ID => {
37672 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
37673 }
37674 AVAILABLE_MODES_DATA::ID => {
37675 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
37676 }
37677 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
37678 AVAILABLE_MODES_MONITOR_DATA::random(rng),
37679 )),
37680 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
37681 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
37682 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
37683 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
37684 CAMERA_CAPTURE_STATUS_DATA::random(rng),
37685 )),
37686 CAMERA_FOV_STATUS_DATA::ID => {
37687 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
37688 }
37689 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
37690 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
37691 )),
37692 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
37693 CAMERA_INFORMATION_DATA::random(rng),
37694 )),
37695 CAMERA_SETTINGS_DATA::ID => {
37696 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
37697 }
37698 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
37699 CAMERA_THERMAL_RANGE_DATA::random(rng),
37700 )),
37701 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
37702 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
37703 )),
37704 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
37705 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
37706 )),
37707 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
37708 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
37709 CAN_FILTER_MODIFY_DATA::ID => {
37710 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
37711 }
37712 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
37713 CELLULAR_CONFIG_DATA::ID => {
37714 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
37715 }
37716 CELLULAR_STATUS_DATA::ID => {
37717 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
37718 }
37719 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
37720 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
37721 )),
37722 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
37723 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
37724 )),
37725 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
37726 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
37727 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
37728 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
37729 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
37730 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
37731 COMPONENT_INFORMATION_DATA::random(rng),
37732 )),
37733 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
37734 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
37735 )),
37736 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
37737 COMPONENT_METADATA_DATA::random(rng),
37738 )),
37739 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
37740 CONTROL_SYSTEM_STATE_DATA::random(rng),
37741 )),
37742 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
37743 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
37744 )),
37745 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
37746 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
37747 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
37748 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
37749 )),
37750 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
37751 DEBUG_FLOAT_ARRAY_DATA::ID => {
37752 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
37753 }
37754 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
37755 DISTANCE_SENSOR_DATA::ID => {
37756 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
37757 }
37758 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
37759 ENCAPSULATED_DATA_DATA::ID => {
37760 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
37761 }
37762 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
37763 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
37764 ESTIMATOR_STATUS_DATA::ID => {
37765 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
37766 }
37767 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
37768 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
37769 EXTENDED_SYS_STATE_DATA::random(rng),
37770 )),
37771 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
37772 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
37773 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
37774 )),
37775 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
37776 FLIGHT_INFORMATION_DATA::random(rng),
37777 )),
37778 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
37779 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
37780 GENERATOR_STATUS_DATA::ID => {
37781 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
37782 }
37783 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
37784 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
37785 )),
37786 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
37787 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
37788 )),
37789 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
37790 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
37791 )),
37792 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
37793 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
37794 )),
37795 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
37796 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
37797 )),
37798 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
37799 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
37800 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
37801 ))
37802 }
37803 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
37804 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
37805 )),
37806 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
37807 GIMBAL_MANAGER_STATUS_DATA::random(rng),
37808 )),
37809 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
37810 GLOBAL_POSITION_INT_DATA::random(rng),
37811 )),
37812 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
37813 GLOBAL_POSITION_INT_COV_DATA::random(rng),
37814 )),
37815 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
37816 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
37817 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
37818 ))
37819 }
37820 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
37821 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
37822 GPS_GLOBAL_ORIGIN_DATA::ID => {
37823 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
37824 }
37825 GPS_INJECT_DATA_DATA::ID => {
37826 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
37827 }
37828 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
37829 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
37830 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
37831 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
37832 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
37833 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
37834 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
37835 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
37836 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
37837 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
37838 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
37839 )),
37840 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
37841 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
37842 HIL_OPTICAL_FLOW_DATA::ID => {
37843 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
37844 }
37845 HIL_RC_INPUTS_RAW_DATA::ID => {
37846 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
37847 }
37848 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
37849 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
37850 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
37851 HIL_STATE_QUATERNION_DATA::random(rng),
37852 )),
37853 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
37854 HYGROMETER_SENSOR_DATA::ID => {
37855 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
37856 }
37857 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
37858 ILLUMINATOR_STATUS_DATA::random(rng),
37859 )),
37860 ISBD_LINK_STATUS_DATA::ID => {
37861 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
37862 }
37863 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
37864 LINK_NODE_STATUS_DATA::ID => {
37865 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
37866 }
37867 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
37868 LOCAL_POSITION_NED_DATA::random(rng),
37869 )),
37870 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
37871 LOCAL_POSITION_NED_COV_DATA::random(rng),
37872 )),
37873 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
37874 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
37875 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
37876 ))
37877 }
37878 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
37879 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
37880 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
37881 LOGGING_DATA_ACKED_DATA::random(rng),
37882 )),
37883 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
37884 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
37885 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
37886 LOG_REQUEST_DATA_DATA::ID => {
37887 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
37888 }
37889 LOG_REQUEST_END_DATA::ID => {
37890 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
37891 }
37892 LOG_REQUEST_LIST_DATA::ID => {
37893 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
37894 }
37895 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
37896 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
37897 MANUAL_SETPOINT_DATA::ID => {
37898 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
37899 }
37900 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
37901 MESSAGE_INTERVAL_DATA::ID => {
37902 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
37903 }
37904 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
37905 MISSION_CLEAR_ALL_DATA::ID => {
37906 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
37907 }
37908 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
37909 MISSION_CURRENT_DATA::ID => {
37910 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
37911 }
37912 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
37913 MISSION_ITEM_INT_DATA::ID => {
37914 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
37915 }
37916 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
37917 MISSION_ITEM_REACHED_DATA::random(rng),
37918 )),
37919 MISSION_REQUEST_DATA::ID => {
37920 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
37921 }
37922 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
37923 MISSION_REQUEST_INT_DATA::random(rng),
37924 )),
37925 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
37926 MISSION_REQUEST_LIST_DATA::random(rng),
37927 )),
37928 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
37929 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
37930 )),
37931 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
37932 MISSION_SET_CURRENT_DATA::random(rng),
37933 )),
37934 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
37935 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
37936 )),
37937 MOUNT_ORIENTATION_DATA::ID => {
37938 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
37939 }
37940 NAMED_VALUE_FLOAT_DATA::ID => {
37941 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
37942 }
37943 NAMED_VALUE_INT_DATA::ID => {
37944 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
37945 }
37946 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
37947 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
37948 )),
37949 OBSTACLE_DISTANCE_DATA::ID => {
37950 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
37951 }
37952 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
37953 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
37954 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
37955 )),
37956 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
37957 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
37958 )),
37959 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
37960 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
37961 )),
37962 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
37963 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
37964 )),
37965 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
37966 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
37967 )),
37968 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
37969 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
37970 )),
37971 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
37972 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
37973 )),
37974 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
37975 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
37976 )),
37977 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
37978 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
37979 )),
37980 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
37981 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
37982 )),
37983 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
37984 OPTICAL_FLOW_RAD_DATA::ID => {
37985 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
37986 }
37987 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
37988 ORBIT_EXECUTION_STATUS_DATA::random(rng),
37989 )),
37990 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
37991 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
37992 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
37993 )),
37994 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
37995 PARAM_EXT_REQUEST_READ_DATA::random(rng),
37996 )),
37997 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
37998 PARAM_EXT_VALUE_DATA::ID => {
37999 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
38000 }
38001 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
38002 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
38003 PARAM_REQUEST_LIST_DATA::random(rng),
38004 )),
38005 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
38006 PARAM_REQUEST_READ_DATA::random(rng),
38007 )),
38008 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
38009 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
38010 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
38011 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
38012 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
38013 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
38014 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
38015 )),
38016 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
38017 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
38018 )),
38019 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
38020 PROTOCOL_VERSION_DATA::ID => {
38021 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
38022 }
38023 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
38024 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
38025 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
38026 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
38027 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
38028 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
38029 RC_CHANNELS_OVERRIDE_DATA::random(rng),
38030 )),
38031 RC_CHANNELS_RAW_DATA::ID => {
38032 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
38033 }
38034 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
38035 RC_CHANNELS_SCALED_DATA::random(rng),
38036 )),
38037 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
38038 REQUEST_DATA_STREAM_DATA::random(rng),
38039 )),
38040 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
38041 RESOURCE_REQUEST_DATA::ID => {
38042 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
38043 }
38044 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
38045 RESPONSE_EVENT_ERROR_DATA::random(rng),
38046 )),
38047 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
38048 SAFETY_ALLOWED_AREA_DATA::random(rng),
38049 )),
38050 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
38051 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
38052 )),
38053 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
38054 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
38055 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
38056 SCALED_PRESSURE_DATA::ID => {
38057 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
38058 }
38059 SCALED_PRESSURE2_DATA::ID => {
38060 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
38061 }
38062 SCALED_PRESSURE3_DATA::ID => {
38063 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
38064 }
38065 SCRIPT_COUNT_DATA::ID => Some(Self::SCRIPT_COUNT(SCRIPT_COUNT_DATA::random(rng))),
38066 SCRIPT_CURRENT_DATA::ID => Some(Self::SCRIPT_CURRENT(SCRIPT_CURRENT_DATA::random(rng))),
38067 SCRIPT_ITEM_DATA::ID => Some(Self::SCRIPT_ITEM(SCRIPT_ITEM_DATA::random(rng))),
38068 SCRIPT_REQUEST_DATA::ID => Some(Self::SCRIPT_REQUEST(SCRIPT_REQUEST_DATA::random(rng))),
38069 SCRIPT_REQUEST_LIST_DATA::ID => Some(Self::SCRIPT_REQUEST_LIST(
38070 SCRIPT_REQUEST_LIST_DATA::random(rng),
38071 )),
38072 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
38073 SERVO_OUTPUT_RAW_DATA::ID => {
38074 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
38075 }
38076 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
38077 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
38078 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
38079 )),
38080 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
38081 SET_ATTITUDE_TARGET_DATA::random(rng),
38082 )),
38083 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
38084 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
38085 )),
38086 SET_HOME_POSITION_DATA::ID => {
38087 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
38088 }
38089 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
38090 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
38091 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
38092 )),
38093 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
38094 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
38095 )),
38096 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
38097 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
38098 SMART_BATTERY_INFO_DATA::random(rng),
38099 )),
38100 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
38101 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
38102 STORAGE_INFORMATION_DATA::random(rng),
38103 )),
38104 SUPPORTED_TUNES_DATA::ID => {
38105 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
38106 }
38107 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
38108 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
38109 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
38110 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
38111 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
38112 TERRAIN_REQUEST_DATA::ID => {
38113 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
38114 }
38115 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
38116 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
38117 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
38118 )),
38119 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
38120 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
38121 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
38122 ))
38123 }
38124 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
38125 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
38126 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
38127 ))
38128 }
38129 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
38130 UAVCAN_NODE_INFO_DATA::ID => {
38131 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
38132 }
38133 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
38134 UAVCAN_NODE_STATUS_DATA::random(rng),
38135 )),
38136 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
38137 UTM_GLOBAL_POSITION_DATA::random(rng),
38138 )),
38139 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
38140 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
38141 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
38142 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
38143 VICON_POSITION_ESTIMATE_DATA::random(rng),
38144 )),
38145 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
38146 VIDEO_STREAM_INFORMATION_DATA::random(rng),
38147 )),
38148 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
38149 VIDEO_STREAM_STATUS_DATA::random(rng),
38150 )),
38151 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
38152 VISION_POSITION_ESTIMATE_DATA::random(rng),
38153 )),
38154 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
38155 VISION_SPEED_ESTIMATE_DATA::random(rng),
38156 )),
38157 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
38158 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
38159 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
38160 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
38161 _ => None,
38162 }
38163 }
38164 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
38165 match self {
38166 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
38167 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
38168 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
38169 Self::AIS_VESSEL(body) => body.ser(version, bytes),
38170 Self::ALTITUDE(body) => body.ser(version, bytes),
38171 Self::ATTITUDE(body) => body.ser(version, bytes),
38172 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
38173 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
38174 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
38175 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
38176 Self::AUTH_KEY(body) => body.ser(version, bytes),
38177 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
38178 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
38179 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
38180 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
38181 Self::BATTERY_INFO(body) => body.ser(version, bytes),
38182 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
38183 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
38184 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
38185 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
38186 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
38187 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
38188 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
38189 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
38190 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
38191 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
38192 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
38193 Self::CANFD_FRAME(body) => body.ser(version, bytes),
38194 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
38195 Self::CAN_FRAME(body) => body.ser(version, bytes),
38196 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
38197 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
38198 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
38199 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
38200 Self::COLLISION(body) => body.ser(version, bytes),
38201 Self::COMMAND_ACK(body) => body.ser(version, bytes),
38202 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
38203 Self::COMMAND_INT(body) => body.ser(version, bytes),
38204 Self::COMMAND_LONG(body) => body.ser(version, bytes),
38205 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
38206 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
38207 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
38208 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
38209 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
38210 Self::CURRENT_MODE(body) => body.ser(version, bytes),
38211 Self::DATA_STREAM(body) => body.ser(version, bytes),
38212 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
38213 Self::DEBUG(body) => body.ser(version, bytes),
38214 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
38215 Self::DEBUG_VECT(body) => body.ser(version, bytes),
38216 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
38217 Self::EFI_STATUS(body) => body.ser(version, bytes),
38218 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
38219 Self::ESC_INFO(body) => body.ser(version, bytes),
38220 Self::ESC_STATUS(body) => body.ser(version, bytes),
38221 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
38222 Self::EVENT(body) => body.ser(version, bytes),
38223 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
38224 Self::FENCE_STATUS(body) => body.ser(version, bytes),
38225 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
38226 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
38227 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
38228 Self::FUEL_STATUS(body) => body.ser(version, bytes),
38229 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
38230 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
38231 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
38232 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
38233 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
38234 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
38235 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
38236 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
38237 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
38238 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
38239 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
38240 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
38241 Self::GPS2_RAW(body) => body.ser(version, bytes),
38242 Self::GPS2_RTK(body) => body.ser(version, bytes),
38243 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
38244 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
38245 Self::GPS_INPUT(body) => body.ser(version, bytes),
38246 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
38247 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
38248 Self::GPS_RTK(body) => body.ser(version, bytes),
38249 Self::GPS_STATUS(body) => body.ser(version, bytes),
38250 Self::HEARTBEAT(body) => body.ser(version, bytes),
38251 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
38252 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
38253 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
38254 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
38255 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
38256 Self::HIL_GPS(body) => body.ser(version, bytes),
38257 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
38258 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
38259 Self::HIL_SENSOR(body) => body.ser(version, bytes),
38260 Self::HIL_STATE(body) => body.ser(version, bytes),
38261 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
38262 Self::HOME_POSITION(body) => body.ser(version, bytes),
38263 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
38264 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
38265 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
38266 Self::LANDING_TARGET(body) => body.ser(version, bytes),
38267 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
38268 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
38269 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
38270 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
38271 Self::LOGGING_ACK(body) => body.ser(version, bytes),
38272 Self::LOGGING_DATA(body) => body.ser(version, bytes),
38273 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
38274 Self::LOG_DATA(body) => body.ser(version, bytes),
38275 Self::LOG_ENTRY(body) => body.ser(version, bytes),
38276 Self::LOG_ERASE(body) => body.ser(version, bytes),
38277 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
38278 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
38279 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
38280 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
38281 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
38282 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
38283 Self::MEMORY_VECT(body) => body.ser(version, bytes),
38284 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
38285 Self::MISSION_ACK(body) => body.ser(version, bytes),
38286 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
38287 Self::MISSION_COUNT(body) => body.ser(version, bytes),
38288 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
38289 Self::MISSION_ITEM(body) => body.ser(version, bytes),
38290 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
38291 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
38292 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
38293 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
38294 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
38295 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
38296 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
38297 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
38298 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
38299 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
38300 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
38301 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
38302 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
38303 Self::ODOMETRY(body) => body.ser(version, bytes),
38304 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
38305 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
38306 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
38307 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
38308 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
38309 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
38310 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
38311 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
38312 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
38313 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
38314 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
38315 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
38316 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
38317 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
38318 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
38319 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
38320 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
38321 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
38322 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
38323 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
38324 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
38325 Self::PARAM_SET(body) => body.ser(version, bytes),
38326 Self::PARAM_VALUE(body) => body.ser(version, bytes),
38327 Self::PING(body) => body.ser(version, bytes),
38328 Self::PLAY_TUNE(body) => body.ser(version, bytes),
38329 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
38330 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
38331 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
38332 Self::POWER_STATUS(body) => body.ser(version, bytes),
38333 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
38334 Self::RADIO_STATUS(body) => body.ser(version, bytes),
38335 Self::RAW_IMU(body) => body.ser(version, bytes),
38336 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
38337 Self::RAW_RPM(body) => body.ser(version, bytes),
38338 Self::RC_CHANNELS(body) => body.ser(version, bytes),
38339 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
38340 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
38341 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
38342 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
38343 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
38344 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
38345 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
38346 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
38347 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
38348 Self::SCALED_IMU(body) => body.ser(version, bytes),
38349 Self::SCALED_IMU2(body) => body.ser(version, bytes),
38350 Self::SCALED_IMU3(body) => body.ser(version, bytes),
38351 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
38352 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
38353 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
38354 Self::SCRIPT_COUNT(body) => body.ser(version, bytes),
38355 Self::SCRIPT_CURRENT(body) => body.ser(version, bytes),
38356 Self::SCRIPT_ITEM(body) => body.ser(version, bytes),
38357 Self::SCRIPT_REQUEST(body) => body.ser(version, bytes),
38358 Self::SCRIPT_REQUEST_LIST(body) => body.ser(version, bytes),
38359 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
38360 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
38361 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
38362 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
38363 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
38364 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
38365 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
38366 Self::SET_MODE(body) => body.ser(version, bytes),
38367 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
38368 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
38369 Self::SIM_STATE(body) => body.ser(version, bytes),
38370 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
38371 Self::STATUSTEXT(body) => body.ser(version, bytes),
38372 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
38373 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
38374 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
38375 Self::SYS_STATUS(body) => body.ser(version, bytes),
38376 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
38377 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
38378 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
38379 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
38380 Self::TIMESYNC(body) => body.ser(version, bytes),
38381 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
38382 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
38383 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
38384 Self::TUNNEL(body) => body.ser(version, bytes),
38385 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
38386 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
38387 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
38388 Self::V2_EXTENSION(body) => body.ser(version, bytes),
38389 Self::VFR_HUD(body) => body.ser(version, bytes),
38390 Self::VIBRATION(body) => body.ser(version, bytes),
38391 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
38392 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
38393 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
38394 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
38395 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
38396 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
38397 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
38398 Self::WINCH_STATUS(body) => body.ser(version, bytes),
38399 Self::WIND_COV(body) => body.ser(version, bytes),
38400 }
38401 }
38402 fn extra_crc(id: u32) -> u8 {
38403 match id {
38404 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
38405 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
38406 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
38407 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
38408 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
38409 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
38410 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
38411 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
38412 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
38413 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
38414 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
38415 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
38416 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
38417 }
38418 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
38419 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
38420 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
38421 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
38422 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
38423 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
38424 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
38425 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
38426 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
38427 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
38428 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
38429 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
38430 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
38431 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
38432 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
38433 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
38434 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
38435 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
38436 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
38437 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
38438 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
38439 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
38440 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
38441 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
38442 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
38443 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
38444 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
38445 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
38446 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
38447 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
38448 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
38449 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
38450 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
38451 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
38452 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
38453 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
38454 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
38455 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
38456 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
38457 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
38458 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
38459 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
38460 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
38461 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
38462 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
38463 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
38464 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
38465 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
38466 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
38467 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
38468 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
38469 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
38470 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
38471 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
38472 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
38473 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
38474 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
38475 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
38476 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
38477 }
38478 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
38479 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
38480 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
38481 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
38482 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
38483 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
38484 }
38485 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
38486 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
38487 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
38488 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
38489 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
38490 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
38491 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
38492 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
38493 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
38494 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
38495 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
38496 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
38497 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
38498 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
38499 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
38500 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
38501 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
38502 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
38503 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
38504 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
38505 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
38506 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
38507 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
38508 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
38509 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
38510 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
38511 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
38512 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
38513 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
38514 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
38515 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
38516 }
38517 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
38518 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
38519 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
38520 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
38521 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
38522 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
38523 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
38524 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
38525 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
38526 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
38527 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
38528 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
38529 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
38530 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
38531 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
38532 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
38533 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
38534 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
38535 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
38536 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
38537 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
38538 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
38539 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
38540 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
38541 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
38542 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
38543 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
38544 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
38545 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
38546 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
38547 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
38548 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
38549 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
38550 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
38551 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
38552 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
38553 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
38554 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
38555 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
38556 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
38557 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
38558 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
38559 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
38560 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
38561 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
38562 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
38563 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
38564 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
38565 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
38566 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
38567 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
38568 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
38569 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
38570 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
38571 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
38572 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
38573 PING_DATA::ID => PING_DATA::EXTRA_CRC,
38574 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
38575 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
38576 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
38577 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
38578 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
38579 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
38580 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
38581 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
38582 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
38583 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
38584 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
38585 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
38586 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
38587 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
38588 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
38589 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
38590 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
38591 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
38592 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
38593 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
38594 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
38595 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
38596 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
38597 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
38598 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
38599 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
38600 SCRIPT_COUNT_DATA::ID => SCRIPT_COUNT_DATA::EXTRA_CRC,
38601 SCRIPT_CURRENT_DATA::ID => SCRIPT_CURRENT_DATA::EXTRA_CRC,
38602 SCRIPT_ITEM_DATA::ID => SCRIPT_ITEM_DATA::EXTRA_CRC,
38603 SCRIPT_REQUEST_DATA::ID => SCRIPT_REQUEST_DATA::EXTRA_CRC,
38604 SCRIPT_REQUEST_LIST_DATA::ID => SCRIPT_REQUEST_LIST_DATA::EXTRA_CRC,
38605 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
38606 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
38607 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
38608 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
38609 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
38610 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
38611 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
38612 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
38613 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
38614 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
38615 }
38616 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
38617 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
38618 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
38619 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
38620 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
38621 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
38622 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
38623 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
38624 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
38625 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
38626 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
38627 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
38628 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
38629 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
38630 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
38631 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
38632 }
38633 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
38634 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
38635 }
38636 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
38637 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
38638 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
38639 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
38640 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
38641 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
38642 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
38643 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
38644 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
38645 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
38646 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
38647 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
38648 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
38649 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
38650 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
38651 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
38652 _ => 0,
38653 }
38654 }
38655 fn target_system_id(&self) -> Option<u8> {
38656 match self {
38657 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
38658 Self::CANFD_FRAME(inner) => Some(inner.target_system),
38659 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
38660 Self::CAN_FRAME(inner) => Some(inner.target_system),
38661 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
38662 Self::COMMAND_ACK(inner) => Some(inner.target_system),
38663 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
38664 Self::COMMAND_INT(inner) => Some(inner.target_system),
38665 Self::COMMAND_LONG(inner) => Some(inner.target_system),
38666 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
38667 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
38668 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
38669 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
38670 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
38671 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
38672 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
38673 Self::LOGGING_ACK(inner) => Some(inner.target_system),
38674 Self::LOGGING_DATA(inner) => Some(inner.target_system),
38675 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
38676 Self::LOG_ERASE(inner) => Some(inner.target_system),
38677 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
38678 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
38679 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
38680 Self::MISSION_ACK(inner) => Some(inner.target_system),
38681 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
38682 Self::MISSION_COUNT(inner) => Some(inner.target_system),
38683 Self::MISSION_ITEM(inner) => Some(inner.target_system),
38684 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
38685 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
38686 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
38687 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
38688 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
38689 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
38690 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
38691 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
38692 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
38693 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
38694 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
38695 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
38696 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
38697 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
38698 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
38699 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
38700 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
38701 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
38702 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
38703 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
38704 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
38705 Self::PARAM_SET(inner) => Some(inner.target_system),
38706 Self::PING(inner) => Some(inner.target_system),
38707 Self::PLAY_TUNE(inner) => Some(inner.target_system),
38708 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
38709 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
38710 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
38711 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
38712 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
38713 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
38714 Self::SCRIPT_COUNT(inner) => Some(inner.target_system),
38715 Self::SCRIPT_ITEM(inner) => Some(inner.target_system),
38716 Self::SCRIPT_REQUEST(inner) => Some(inner.target_system),
38717 Self::SCRIPT_REQUEST_LIST(inner) => Some(inner.target_system),
38718 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
38719 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
38720 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
38721 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
38722 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
38723 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
38724 Self::SET_MODE(inner) => Some(inner.target_system),
38725 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
38726 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
38727 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
38728 Self::TIMESYNC(inner) => Some(inner.target_system),
38729 Self::TUNNEL(inner) => Some(inner.target_system),
38730 Self::V2_EXTENSION(inner) => Some(inner.target_system),
38731 _ => None,
38732 }
38733 }
38734 fn target_component_id(&self) -> Option<u8> {
38735 match self {
38736 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
38737 Self::CANFD_FRAME(inner) => Some(inner.target_component),
38738 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
38739 Self::CAN_FRAME(inner) => Some(inner.target_component),
38740 Self::COMMAND_ACK(inner) => Some(inner.target_component),
38741 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
38742 Self::COMMAND_INT(inner) => Some(inner.target_component),
38743 Self::COMMAND_LONG(inner) => Some(inner.target_component),
38744 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
38745 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
38746 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
38747 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
38748 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
38749 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
38750 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
38751 Self::LOGGING_ACK(inner) => Some(inner.target_component),
38752 Self::LOGGING_DATA(inner) => Some(inner.target_component),
38753 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
38754 Self::LOG_ERASE(inner) => Some(inner.target_component),
38755 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
38756 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
38757 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
38758 Self::MISSION_ACK(inner) => Some(inner.target_component),
38759 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
38760 Self::MISSION_COUNT(inner) => Some(inner.target_component),
38761 Self::MISSION_ITEM(inner) => Some(inner.target_component),
38762 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
38763 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
38764 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
38765 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
38766 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
38767 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
38768 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
38769 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
38770 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
38771 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
38772 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
38773 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
38774 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
38775 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
38776 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
38777 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
38778 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
38779 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
38780 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
38781 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
38782 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
38783 Self::PARAM_SET(inner) => Some(inner.target_component),
38784 Self::PING(inner) => Some(inner.target_component),
38785 Self::PLAY_TUNE(inner) => Some(inner.target_component),
38786 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
38787 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
38788 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
38789 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
38790 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
38791 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
38792 Self::SCRIPT_COUNT(inner) => Some(inner.target_component),
38793 Self::SCRIPT_ITEM(inner) => Some(inner.target_component),
38794 Self::SCRIPT_REQUEST(inner) => Some(inner.target_component),
38795 Self::SCRIPT_REQUEST_LIST(inner) => Some(inner.target_component),
38796 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
38797 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
38798 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
38799 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
38800 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
38801 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
38802 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
38803 Self::TIMESYNC(inner) => Some(inner.target_component),
38804 Self::TUNNEL(inner) => Some(inner.target_component),
38805 Self::V2_EXTENSION(inner) => Some(inner.target_component),
38806 _ => None,
38807 }
38808 }
38809}